Question
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689980000/6662125b-874e-4717-b6ec-903269dec7a4.jpg?itok=lO5fHFAP)
standard chartered bank
IN
Last activity: 5 May 2017 8:33 EDT
Soap Service with Custom Error
Hi Team,
I created a SOAP service with basic authentication. let we take the scenario
Ex .If authentication failure happen we can define as Fault tab Security Error to set some constant value " Service Failed due to bad Authentication " . So we get the below response.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Service Failed due to bad Authentication</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Instead (<soap:Fault>) of above response how to set the customized Error as below . ( Note : If authentication fails, service activity should not be invoked )
Customized Error Response FYI :
Hi Team,
I created a SOAP service with basic authentication. let we take the scenario
Ex .If authentication failure happen we can define as Fault tab Security Error to set some constant value " Service Failed due to bad Authentication " . So we get the below response.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Service Failed due to bad Authentication</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Instead (<soap:Fault>) of above response how to set the customized Error as below . ( Note : If authentication fails, service activity should not be invoked )
Customized Error Response FYI :
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:ErrorData>
<ErrorID>123</ErrorID>
<Error Details>Service Failed due to bad Authentication</Error Details>
</soap:ErrorData>
</soap:Body>
</soap:Envelope>