wood burning stoves 2.0*
The moose likes Web Services and the fly likes Passing XML document to Web service ::  Operation param's type <xsd:any/> or <xsd:string> ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Passing XML document to Web service ::  Operation param Watch "Passing XML document to Web service ::  Operation param New topic
Author

Passing XML document to Web service :: Operation param's type <xsd:any/> or <xsd:string> ?

Suresh Gopi
Ranch Hand

Joined: Mar 08, 2007
Posts: 49
Hi Guys,

I'm creating a WSDL for my web service and trying to make it as generic one. I'm using document\literal style for the operation.
Input and output for the operation will be XML fragment like below..


Request xml
------------

<message action="add">
<person>.......</person>
</message>

Respone xml
---------------

<message status="1" >
<person-id>123</person-id>
</message>

Please note <message> element is envelope for the input and ouput XML document. ( At service provider end, based on action attribute's value appropriate operation will be performed)


Please suggest me what data type should be appropriate for <message> element's content ? <xsd:string> or <xsd:any/>
which has got more benefits? (Simple/flexible for processing for both client & service provider)


Element definition in WSDL
----------------------------------

<xsd:element name="message">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="xmlDocString" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="action" type="xsd:string" />
</xsd:complexType>
</xsd:element>


<xsd:element name="message">
<xsd:complexType>
<xsd:sequence>
<xsd:any/>
</xsd:sequence>
<xsd:attribute name="action" type="xsd:string" />
</xsd:complexType>
</xsd:element>

Am i making sense? If not please let me know i can provide some more details.


Tool kit used: Axis 1.4

Thanks a lot for reading my message till this point. :-)

Regards<br />Suresh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing XML document to Web service :: Operation param's type <xsd:any/> or <xsd:string> ?
 
Similar Threads
Client stubs incorrect from wsdl using Axis
WSDL generation in Axis - item is referenced but not defined
Cannot create service instance, service 'x' not found in wsdl
Invoking Webservice having Complex Types
How to access byte array web method