How do I return a service exception as a SOAP exception.

Hello,

I am working on a new set set of interface service which calls for errors to be returned as SOAP exceptions. The service utilizes MTOM to process file attachments.

The service output has one optional out parameter that is only set when the service is successful.

If there is a failure, I exit the service an signal a failure with a specific error message.

I want the client (in this case, a .NET web application) to be able to trap on an exception and get the specific error message I set in the service.

In testing, all I get now is the typical “Error encoding RPC output”.
I want my custom error to be returned as well (ie. “Invalid input arguement: typeID”).

Here is the current SOAP response:

HTTP/1.0 500 Internal Server Error
Set-Cookie: ssnid=9a566790adc511de8fcbd4666039851d; path=/; HttpOnly
Content-Type: application/soap+xml; charset=UTF-8
Content-Length: 1238

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope
xmlns:SOAP-ENV=“http://www.w3.org/2003/05/soap-envelope
xmlns:SOAP-ENC=“http://www.w3.org/2003/05/soap-encoding
xmlns:xml=“The "xml:" Namespace
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
xmlns:xsd=“XML Schema”>
SOAP-ENV:Body
SOAP-ENV:Fault
SOAP-ENV:CodeSOAP-ENV:ValueSOAP-ENV:Sender</SOAP-ENV:Value></SOAP-ENV:Code>
SOAP-ENV:Reason
<SOAP-ENV:Text xml:lang=“”>[ISS.0088.9133] Error while encoding RPC output</SOAP-ENV:Text>
</SOAP-ENV:Reason>
SOAP-ENV:Rolehttp://baeairptdvl1.nu.com:5560/ws/cmis.pub.wsds:ObjectService</SOAP-ENV:Role>
<SOAP-ENV:Detail xmlns:webM=“API Integration Platform | Software AG”>
webM:exception
webM:classNamejavax.xml.soap.SOAPException</webM:className>
<webM:message xml:lang=“”>MTOM Attachments Processing Failed: Cannot convert SOAP Message to XOP Package; Some of the operation in a ‘Web Service Descriptor’ contains ‘null’ value for either input or output signature</webM:message>
</webM:exception>
</SOAP-ENV:Detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

No response needed anymore. I forgot to mention that in IS 7.1.2.

After more digging I realized that the “SOAP Developers guide” was pointing me in a wrong direction.

In 7.1.2 there is the new “webservice descriptor” objects.
After creating a new “provider”, I expanded the “Response” definition and added a document to the “Fault” section.

I created a new document type that will be used to provide the error message.
It appears that you can put any data elements you want in this document and it will be return as a SOAP Fault in the body of the SOAP Response message.