Dénes Paczolay · Dec 17, 2018

Adding fault to a wsdl


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 name="myOperationSoapIn">
        <part name="myOperationRequest" element="s1:myOperationRequest"/>
    <message name="myOperationSoapOut">
        <part name="myOperationResponse" element="s1:myOperationResponse"/>
    <portType name="MyServiceSoap">
        <operation name="myOperation">
            <input message="s0:myOperationSoapIn"/>
            <output message="s0:myOperationSoapOut"/>
            <fault message="s0:MyFault" name="MyFault"/>
    <binding name="MyServiceSoap" type="s0:MyServiceSoap">
        <soap:binding transport="" style="document"/>
        <operation name="myOperation">
            <soap:operation soapAction="" style="document"/>
                <soap:body use="literal"/>
                <soap:body use="literal"/>
            <fault name="MyFault">
                <soap:fault use="literal" name="MyFault"/>




0 2,146
Discussion (3)1
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
- use the new set of classes
- 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?



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

similar to 

<definitions xmlns="" xmlns:SOAP-ENC=""" xmlns:s="" xmlns:s0=""xmlns:soap="" xmlns:wsdl="" xmlns:xsi="" targetNamespace="">

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.