KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > userguide > clients > ClientUtil


1
2 package userguide.clients;
3
4 import org.apache.axis2.om.OMAbstractFactory;
5 import org.apache.axis2.om.OMElement;
6 import org.apache.axis2.om.OMFactory;
7 import org.apache.axis2.om.OMNamespace;
8
9 /*
10  * Copyright 2001-2004 The Apache Software Foundation.
11  *
12  * Licensed under the Apache License, Version 2.0 (the "License");
13  * you may not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */

24
25
26 public class ClientUtil {
27
28     public static OMElement getEchoOMElement(){
29       OMFactory fac = OMAbstractFactory.getOMFactory();
30         OMNamespace omNs = fac.createOMNamespace("http://example1.org/example1", "example1");
31         OMElement method = fac.createOMElement("echo", omNs);
32         OMElement value = fac.createOMElement("Text", omNs);
33         value.addChild(fac.createText(value, "Axis2 Echo String "));
34         method.addChild(value);
35
36         return method;
37     }
38     public static OMElement getPingOMElement(){
39         OMFactory fac = OMAbstractFactory.getOMFactory();
40         OMNamespace omNs = fac.createOMNamespace("http://example1.org/example1", "example1");
41         OMElement method = fac.createOMElement("ping", omNs);
42         OMElement value = fac.createOMElement("Text", omNs);
43         value.addChild(fac.createText(value, "Axis2 Ping String "));
44         method.addChild(value);
45
46         return method;
47     }
48
49
50 }
51
Popular Tags