WebSphere Message Service Clients: Web Services Client for C++, Version 1.1 Operating Systems: Linux, Windows

SOAP faults defined in a WSDL file

Use this example of a typical WSDL that contains fault messages to find out how SOAP faults are defined in a WSDL file.

The following example of a typical WSDL file contains a port type called “MathOps”. There is an operation called “div” that has three possible fault messages called “DivByZeroStruct”, “SpecialDetailStruct” and “OutOfBoundStruct”.

<wsdl:portType name="MathOps">
 <wsdl:operation name="div">
  <wsdl:input message="impl:divRequest" name="divRequest"/>
  <wsdl:output message="impl:divResponse" name="divResponse"/>
  <wsdl:fault message="impl:DivByZeroStruct" name="DivByZeroStruct"/>
  <wsdl:fault message="impl:SpecialDetailStruct" name="SpecialDetailStruct"/>
  <wsdl:fault message="impl:OutOfBoundStruct" name="OutOfBoundStruct"/>
 </wsdl:operation>
</wsdl:portType>

The definition of these message structures is described earlier in the WSDL as follows:

<complexType name="OutOfBoundStruct">
 <sequence>
  <element name="varString" nillable="true" type="xsd:string"/>
  <element name="varInt" type="xsd:int"/>
  <element name="specialDetail" nillable="true" type="impl:SpecialDetailStruct"/>
 </sequence>
</complexType>
<complexType name="SpecialDetailStruct">
 <sequence>
  <element name="varString" nillable="true" type="xsd:string"/>
 </sequence>
</complexType>
<element name="OutOfBoundStruct" nillable="true" type="impl:OutOfBoundStruct"/>
<complexType name="DivByZeroStruct">
 <sequence>
  <element name="varString" nillable="true" type="xsd:string"/>
  <element name="varInt" type="xsd:int"/>
  <element name="varFloat" type="xsd:float"/>
 </sequence>
</complexType>
Related reference
Generated stubs
Other exceptions
Client application

Reference topic

Terms of Use | Rate this page

Last updated: 25 Jan 2006

© Copyright IBM Corporation 2005, 2006. All Rights Reserved.