Populate the SOAP-ENV:Fault document using the desired custom values(you can find the structure of this document in any generated WebServiceConnector).
Convert the document to an XML String using pub.xml:documentToString
Convert the xmldata to an xmlnode using pub.xml:xmlStringToXMLNode
Create an empty soap document using pub.soap.utils:createSoapData
Add the node as a body entry using pub.soap.utils:addBodyEntry
Map the result to the soapResponseData object
Cleanup the pipeline so that only soapResponseData remains
Use the pub.flow:setResponse to set the HTTP response to soapResponseData
Use the pub.flow:setResponseCode to set the HTTP return code to “500”
Mark,
If I have read the SOAP 1.1 Spec correctly it requires the SOAP fault message be returned with an HTTP 500 error. I have been able to create a custom SOAP fault message and leave it in the pipeline so the calling application can read it but as far as I can tell the only way to send an HTTP 500 error back is by throwing an error in the custom SOAP processor by invoking the “Exit ‘$flow’ and signal FAILURE”. If I signal failure then the custom SOAP processor generates it’s own SOAP fault message and the best I can do is pass an error text into the Exit step. Am I missing something here?
I spent 8 hours trying to get a http status code of 500 on my custom soap faults.
I really wish that they would include the calls to pub.flow:setResponse and pub.flow:setResponseCode in the SOAP developers guide, would have saved me a day!