How to return 

  

I develop one web service in outsystem. I want to raise exception when the input parameters are not valid. And the client should receive the info in below:

<soap:Fault>

    <soap:faultcode>XXX</saop:faultcode>

    <soap:faultstring>XXX</soap:faultstring>

</soap:Fault>

I defined some xceptions and the error messages. But the client receive the info:

<soap:Fault>

    <soap:faultcode>soap:Server</saop:faultcode>

    <soap:faultstring>Server was unable to process request --> XXXX (the error message that I defined)</soap:faultstring>

</soap:Fault>

The content in <soap:faultcode> is always same.

How can I let <soap:faultcode> to use what I defined? And how to let <soap:faultstring> to only show the error message that I defined?

Greetings Claire,

Unfortunately it's not possible to customize how SOAP faults are generated from a raised exception. Also, according to this, faultcode accepts only a set of values: VersionMismatch, MustUnderstand, Client, or Server.


So I think you'll either have to:

  1. Alter the client to accept the fault in the format OutSystems sends, which is the better option, or if not possible,
  2. Create a proxy, to do some pre-processing on the server response before delivering it to the client


Let me know if you have further questions.


Best regards,

Pedro Guimarães

Pedro Guimarães wrote:

Greetings Claire,

Unfortunately it's not possible to customize how SOAP faults are generated from a raised exception. Also, according to this, faultcode accepts only a set of values: VersionMismatch, MustUnderstand, Client, or Server.


So I think you'll either have to:

  1. Alter the client to accept the fault in the format OutSystems sends, which is the better option, or if not possible,
  2. Create a proxy, to do some pre-processing on the server response before delivering it to the client


Let me know if you have further questions.


Best regards,

Pedro Guimarães

Thank you for your reply. But may I know how to create the Proxy? Shall I write my own espace/extension to do that?


Hi Chen,


SOAP-ENV:ServerThere was a problem with the server, so the message could not proceed.


I guess it is not reaching to the point where you defined your fault code and message and before that itself it is getting problem.



Regards

-PJ-