Q

Rules specifying faults in a WSDL document

Are there any rules specifying faults in a WSDL document when using the document/literal/wrapped convention?

In my case, I have a schema (types.xsd) that defines an InvalidDataException complexType. In order to specify this fault on a Web service method using the d/l/w convention, would I be required to define an element such as and then define the message as such:

<wsdl:message name="InvalidDataException">
<wsdl:part name="fault" element="tns:InvalidDataException"/>
</wsdl:message>

Or could the message simply reference the complexType defined in the types.xsd as follows:

<wsdl:message name="InvalidDataException">
<wsdl:part name="fault" type="types:InvalidDataException"/>
</wsdl:message>

SOAP Faults should always be defined as doc/literal regardless of the type of service. Therefore it should be defined as such:
<wsdl:message name="InvalidDataException">
<wsdl:part name="fault" element="tns:InvalidDataException"/>
</wsdl:message>

Note that when using doc/literal/wrapped you must reference an element (not a type) from the SOAP body part, too.


This was first published in July 2004

Dig deeper on Simple Object Access Protocol (SOAP)

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close