Search This Blog

Showing posts with label SOAPElement. Show all posts
Showing posts with label SOAPElement. Show all posts

Wednesday, 20 June 2007

Printing the SOAPElement JAX-RPC 1.4 type to standard out

I am constantly consuming web services which have a service class with methods using org.w3c.dom.Element

The web service stub proxy within JDeveloper 10.1.3.x will then use the JAX-RPC 1.4 client interface as follows for clients to consume the web service methods with parameters of this type.

javax.xml.soap.SOAPElement

In order to print out the XML you can easily just use this piece of code to display the XML to standard out for testing purposes.

SOAPElement soapElement =
myPort.executeQuery("select empno, ename, hiredate, deptno from emp");
((XMLElement)soapElement).print(System.out);

Note: XMLElement is fully defined as oracle.xml.parser.v2.XMLElement part of oracle's XML parser V2 which is the JAR file xmlparserv2.jar