1

im developing SOAP WebService Server with Spring boot with SOAP 1.2 Protocol. Im trying to fill the SOAPFault with all details it needs and throwing wrapped in SOAPFaultException. But the SOAPFault response in SOAPUI is not showing the detail information.

Im creating the SOAPFault this way:

SOAPFactory soapFactory = SOAPFactory.newInstance( SOAPConstants.SOAP_1_2_PROTOCOL );
SOAPFault soapFault12 = soapFactory.createFault();
soapFault12.appendFaultSubcode( new QName( "http://test.cz", "404" ) );
soapFault12.setFaultRole( "http://test.cz" );
soapFault12.addFaultReasonText( "AAA", Locale.ENGLISH );
soapFault12.addFaultReasonText( "AAACZ", new Locale("cz", "cs") );
Detail detail = soapFault12.addDetail();
SOAPElement soapElement = detail.addChildElement( new QName( "", "detailTest" ) );
soapElement.addTextNode("TEST.");
throw new SOAPFaultException( soapFault12 );

The response is in SOAP 1.2, but without the attributes like Role, the second FaultResonText and without Detail information.

 <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
   <env:Header/>
   <env:Body>
      <env:Fault>
         <env:Code>
            <env:Value>env:Receiver</env:Value>
         </env:Code>
         <env:Reason>
            <env:Text xml:lang="en">AAA</env:Text>
         </env:Reason>
      </env:Fault>
   </env:Body>
</env:Envelope>

I have searched many hours and played with that, but still no clue what has to be set. Thanx for any help.

Erik Bors
  • 133
  • 1
  • 14

0 Answers0