KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > userguide > example1 > MyService


1 package userguide.example1;
2
3 import org.apache.axis2.om.OMElement;
4
5 import javax.xml.stream.XMLStreamException;
6
7 /**
8  * Created by IntelliJ IDEA.
9  * User: Jaliya
10  * Date: Jun 2, 2005
11  * Time: 2:17:58 PM
12  */

13 public class MyService {
14     public OMElement echo(OMElement element) throws XMLStreamException {
15         //Praparing the OMElement so that it can be attached to another OM Tree.
16
//First the OMElement should be completely build in case it is not fully built and still
17
//some of the xml is in the stream.
18
element.build();
19         //Secondly the OMElement should be detached from the current OMTree so that it can be attached
20
//some other OM Tree. Once detached the OmTree will remove its connections to this OMElement.
21
element.detach();
22         return element;
23     }
24
25     public void ping(OMElement element) throws XMLStreamException {
26     //Do some processing
27
}
28 }
29
Popular Tags