Announcement Announcement Module
Collapse
No announcement yet.
Custom soap fault and wsdl Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom soap fault and wsdl

    In the past, before Spring Web Services, I've used wsdl that looked like this:

    Code:
    <wsdl:operation name="GetUser">
    	<wsdl:input message="useradmin:GetUser"/>
    	<wsdl:output message="useradmin:GetUserResponse"/>
    	<wsdl:fault name="ErrorCodeFault" message="useradmin:ErrorCodeFault"/>
    </wsdl:operation>
    The idea, of course, is that the consumer of the wsdl has some idea which operations return which custom soap faults.

    So far I've been using generated wsdl for my Spring Web Services project. I've got the custom soap fault defined in the xsd:

    Code:
    <element name="GetUserRequestFault">
    	<complexType>
    		<sequence>
    			<element name="ErrorMessage" type="string"/>
    			<element name="ErrorCode" type="string"/>
    			<element name="Login" type="string"/>
    		</sequence>
    	</complexType>
    </element>
    Is there any easy or well known way to get the generated wsdl to include the fault element?

  • #2
    Should have spent more time with the code before posting... I haven't figured it all out yet, but I see that there is wsdl fault generation code.

    Not sure yet why it doesn't work for me, but I'm getting there.

    Comment


    • #3
      With the following schema the wsdl comes out just fine:

      Code:
      <element name="GetUserRequest">
          <complexType>
              <sequence>
                  <element name="Login" type="string"/>
              </sequence>
          </complexType>
      </element>
      
      <element name="GetUserFault">
          <complexType>
              <sequence>
                  <element name="ErrorMessage" type="string"/>
                  <element name="ErrorCode" type="string"/>
                  <element name="Login" type="string"/>
              </sequence>
           </complexType>
      </element>
         
      <element name="GetUserResponse">
          <complexType>
              <sequence>
                  <element name="User" type="user:User"/>
              </sequence>
          </complexType>
      </element>
      The previous version of the schema had a mis-named fault element. It was "GetUserRequestFault". Should be "GetUserFault, as above.

      Comment


      • #4
        Multiple faults for operation

        Is there no way to add more than one fault to a given operation?

        Comment

        Working...
        X