Question
· Dec 17, 2018

Adding fault to a wsdl

Hi,

The fault message definition is missing from my service WSDL. I would like to add these bold styled text to my WSDL. How can I do that? The aim is when I get  the WSDL of MyService with ?wsdl URL the response contains the bold styled text.

For example:

    <message name="MyFault">
        <part name="MyFault" element="s1:MyFault"/>
    </message>

    <message name="myOperationSoapIn">
        <part name="myOperationRequest" element="s1:myOperationRequest"/>
    </message>
    <message name="myOperationSoapOut">
        <part name="myOperationResponse" element="s1:myOperationResponse"/>
    </message>
    <portType name="MyServiceSoap">
        <operation name="myOperation">
            <input message="s0:myOperationSoapIn"/>
            <output message="s0:myOperationSoapOut"/>
            <fault message="s0:MyFault" name="MyFault"/>
        </operation>
    </portType>
    <binding name="MyServiceSoap" type="s0:MyServiceSoap">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
        <operation name="myOperation">
            <soap:operation soapAction="http://test.com/ns/MyService/v1/myOperation" style="document"/>
            <input>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
            <fault name="MyFault">
                <soap:fault use="literal" name="MyFault"/>
            </fault>

        </operation>
    </binding>

Thanks,

Dénes

Discussion (3)0
Log in or sign up to continue

If the definition you get with  ?WSDL contains already the missing parts, then
It may have been changed since your SOAP service in Caché was generated.

You just generate your SOAP service with a different class name again using the new WSDL an then
either
- use the new set of classes
or
- check the differences to your actual services. And adapt it manually.
I'd assume it isn't much more than a property or a serial class. No magic.

Hi Robert,

Thanks for your answer.

I generated a new SOAP service with the wizard (Caché Studio, File/New... General/Web Service). The created WSDL of the new Web Service doesn't contain fault tags either. There is no checkbox or other input field for fault options on wizard page.

I'm using:

Cache' Studio Client  2017.2.2 Build 865
Server Cache for Windows (x86-64) 2017.2.2 (Build 865U_SU)

Do you have further ideas?

Regards,

Dénes

Your snip out from the full WSDL uses XML references s0: and s1:

similar to 

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org"xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://tempuri.org">

In addition I'm somewhat surprised to see  in your operation

            <input message="s0:myOperationSoapIn"/>
            <output message="s0:myOperationSoapOut"/>
            <fault message="s0:MyFault" name="MyFault"/>

This means you have 1 input msg but 2 different output msg.
If you see the Caché side
- input triggers a ClassMethod
- it returns something or returns an error

I'm not aware of some default logic to return a fault message that is generated.
Typically Success/Failure is signaled as part of the output message.    
As a consequence manual modification of the generated code could be required to split
the return message into 2  different message types. 

It's of cause some guessing behind as you didn't publish the full WSDL.