• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Xml document as a SOAP payload

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic