Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

Publishing an XML message definition within a WSDL for Web services

What is the best way to publish a document/literal XML message definition within a Web Services Description Language (WSDL) file?

Should I define a schema that takes a single xsd:string and have clients pass in an XML document wrapped within a CDATA section for more control over versioning, error handling, etc.? Or should I publish strongly typed User Defined Types in the WSDL that exactly map to the XML message?

In the latter case, the message can be validated by the SOAP engine and client code tools, such as WSDL.EXE or WSDL2JAVA, and can create easy to use clients. Which approach makes the most sense and will keep us compliant with WS-* specifications?

Definitely do not send the message as a string wrapped within a CDATA section. That approach defeats many of the valuable features of using SOAP and WSDL. You should strongly type the messages, and specify the type information using XML Schema, for all the reasons you say and more. For example, without a proper schema, you can't specify which parts of the message you would like to sign or encrypt using WS-Security.

Dig Deeper on Topics Archive

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.