File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Suresh Gopi
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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. :-)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic