0

I have a proxy service stup to perform validation against schema and throw a fault if validation fails.

<inSequence>
  <log level="full"/>
  <validate xmlns:lod="http://example.com" source="$body/lod:Request">
        <schema key="gov:/repository/schemas/com/example/data.xsd"/>
        <on-fail>
           <makefault version="soap12">
              <code xmlns:soap12Env="http://www.w3.org/2003/05/soap-envelope" value="soap12Env:Sender"/>
              <reason>Text reason goes here.</reason>
              <node>http://example.com</node>
              <detail/>
              <role/>
           </makefault>
           <send/>
           <drop/>
        </on-fail>
     </validate>
  </inSequence>

This work fine and the request gets validated as expected.

The question is: Is it possible to add subcodes to the fault which is SOAP 1.2 fault to get something similar to the below:

<env:Fault>
 <env:Code>
   <env:Value>env:Sender</env:Value>
     <env:Subcode>
       <env:Value>SOME_SPECIFIC_ERROR_SUBCODE</env:Value>
     </env:Subcode>
 </env:Code>
 <env:Reason>
    <env:Text xml:lang="en">Text reason goes here.</env:Text>
 </env:Reason>
 <env:Node>http://example.com</env:Node>
</env:Fault>

Thank you in advance. Vladimir.

Community
  • 1
  • 1

1 Answers1

1

I think this is what you're looking for:

In this blogpost we will be looking at how to generate a soap fault using the makefault mediator. In addition to that I will show how to embed a custom message within that soap fault. Inorder to achieve this goal we will be using the makefault mediator and a script mediator.

RaviU
  • 1,203
  • 15
  • 17