You need to sign in to do that
Don't have an account?
hirb24
SOAP faultcode response
Hi,
I am programming a webservice in Salesforce and I would like to set my own faultcodes and faultstrings.
I would like to send this kind of response if an error occurs:
<soapenv:Fault>
<faultcode>100</faultcode>
<faultstring> MyMessage</faultstring>
</soapenv:Fault>
Is it possible in Salesforce?
Thanks
Yes I believe this can be done.
Can you please help me i understand how thi can be done?
i was able to generate the Fault string but not the Fault Code..
Any help is appriciated...
public class SoapmsgException extends Exception {}
Webservice static string ContactMethod(String lpid,String Req)
{
...
..
if(lpid.length() == 0)
throw new SoapmsgException ('Invalid LPID or Customer belongs to outfoot Print State');
}
This is how i was able to generate the Fault string... But was not able generate the fault code.
Thanks.