Problem solve Get help with specific problems with your technologies, process and projects.

Replacing fault by output message

I have a WSDL file and wish to know that in the operation, is it possible to replace fault by another output message? For example, is the following part of WSDL according to W3C standards?:

<portType name="portEmpAdd">
<operation name="EmpAdd">
<input name="inEmpAdd" message="def:inEmpAdd" /> 
<output name="outEmpAddResponse0" message="def:outEmpAddResponse0" /> 
<output name="outEmpAddResponse1" message="def:outEmpAddResponse1" /> 

SOAP 1.1 and WSDL 1.1 do not support a message exchange pattern that permits an operation to return more than one output message. These specifications define only two message exchange patterns: one way messages (in which the operation MUST contain one input message and no output or fault messages) and request/response (in which the operation MUST contain one input message and one output message and MAY contain any number of fault messages).

SOAP 1.2 and WSDL 2.0 will permit you to define additional message exchange patterns, but WSDL 2.0 is not yet complete.

If you would like your service to return two possible responses, you must define a single output message, and then define the response element as a choice group. For example:

<s:schema ...>
<s:element name="EmpAddResponse">
    <s:element ref="EmpAddResponse1"/>
    <s:element ref="EmpAddResponse2"/>

<w:message name="outEmpAddResponse"> 
  <w:part name="output" element="def:EmpAddResponse"/>

<w:portType name="portEmpAdd">
 <w:operation name="EmpAdd">
  <w:input name="inEmpAdd" message="def:inEmpAdd" /> 
  <w:output name="outEmpAddResponse" message="def:outEmpAddResponse" /> 

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.