Question

3
Replies
569
Views
CHRISTOPHER-1 Member since 2012 3 posts
Virtusa
Posted: 3 years ago
Last activity: 3 years 5 months ago
Closed

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 :

<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>

Data Integration
Moderation Team has archived post
Share this page LinkedIn