Print this page

Webservice Fault String

Knowledge Article Number 000176962
Description
Scenario-
Webservice is hosted in Salesforce .
The webservice gets called by an external client.
Then in case any error occurs while executing the webservice ; then those errors are returned in soap fault.
 
Sample fault string looks like the following - 
 
 <con1:faultstring>This is error message
 
Class.abcclass.Execute: line 1, column 1 
 
</con1:faultstring>
 
User wants the fault string to only contain the error message and not the stack trace.
So it should look like the following  - 
 <con1:faultstring>This is error message
</con1:faultstring>
Resolution Soap fault from salesforce always contains the stack trace with the error message as this  is the default behavior.
There is no option to control it. 

The only option is to build a wrapper on client side which can catch it and truncate the message.




promote demote