Question
· Oct 11, 2022

Custom SOAP fault

I am creating a soap service according to a wsdl that the client has already coded against.
In their operation they have a fault element Exception:

<operation name="query">
  <soap:operation soapAction=""/>
  <input>
    <soap:body use="literal"/>
  </input>
  <output>
    <soap:body use="literal"/>
  </output>
  <fault name="Exception">
    <soap:fault name="Exception" use="literal"/>
  </fault>
</operation>

which is:

<xsd:complexType name="Exception">
    <xsd:sequence>
        <xsd:element name="message" type="xsd:string" minOccurs="0"/>
    </xsd:sequence>
</xsd:complexType>

I have tried creating a class called "Exception" extending %SOAP.Fault, adding a message property and then do a ReturnFault() but it just shows the standard soap fault.

How do I return a fault object as expected?

Product version: Ensemble 2018.1
$ZV: Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2018.1.7 (Build 721U) Fri Mar 18 2022 22:01:43 EDT
Discussion (2)1
Log in or sign up to continue