Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Xml document as a SOAP payload

 
Suhas Joshi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm presently working on a web services implementation in which it is required that the Client must send a xml document as the request payload. I'm using the SOAP UI to send the request and get the response. How to include the xml file in the SOAP request? What should be the parameter type in the service method?
The response payload is also an xml.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In WSDL the presence of a generic XML document is flagged with the "xsd:anyType" (Mapping XML document to xsd:anyType) or "xsd:any". Under JAX-RPC 1.1 "xsd:any" automatically maps to javax.xml.soap.SOAPElement from which you can extract your org.w3c.dom.Document (which is a org.w3c.dom.Node) for incoming XML. For outgoing XML you simply populate the javax.xml.soap.SOAPElement parameter/return value with your org.w3c.dom.Document.

JAX-WS 2.0 maps "xsd:any" and "xsd:anyType" to org.w3c.dom.Element rather than javax.xml.soap.SOAPElement. (See: Realizing Strategies for Document-Based Web Services With JAX-WS 2.0: Part 3 in a Series)

Tip: xsd:any: A cautionary tale
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic