I get following response. But I couldn't find error code (700001) I have
added at connector side. Only error message is shown inside response body.
How can I get error code?

HTTP/1.1 500 Internal Server Error
Host: localhost:8243
Content-Type: application/json
Date: Thu, 15 May 2014 10:08:14 GMT
Server: WSO2-PassThrough-HTTP
Transfer-Encoding: chunked
Connection: Keep-Alive

{"Exception":"[LDAP: error code 49 - INVALID_CREDENTIALS: Bind failed:
ERR_229 Cannot authenticate user uid=admin,ou=system]"}


On Thu, May 15, 2014 at 8:58 AM, Ramindu Deshapriya <[email protected]>wrote:

> Hi DImuthu,
>
> The HTTP status code will always be 500 for a SOAP fault, which is what
> you're generating here. Your custom error code will be available in the
> message that gets returned within the body of the response.
>
> Thanks.
> On May 14, 2014 6:55 PM, "Dimuthu Upeksha [via WSO2 Oxygen Tank]" <
> [email protected]> wrote:
>
>> Hi,
>>
>> I'm working on LDAP connector for ESB. I have declared some custom error
>> codes to represent errors happening inside the connector
>> Ex
>> Entry already exists : 500001
>> Entry does not exists : 500002
>> Authentication failure : 500003
>>
>> At such situations I use following code sample to move to error sequence
>>
>> messageContext.setProperty(SynapseConstants.ERROR_CODE, errorCode);
>> //here errorCode=500001
>> messageContext.setProperty(SynapseConstants.ERROR_MESSAGE,errorMessage);
>> messageContext.setProperty(SynapseConstants.ERROR_EXCEPTION,e);
>> messageContext.setFaultResponse(true);
>> handleException(errorMessage,e,messageContext);
>>
>> In proxy configuration
>>
>> <faultSequence>
>>        <log level="full"/>
>>        <makefault version="soap11">
>>               <code expression="get-property('ERROR_CODE')"/>
>>               <reason expression="get-property('ERROR_MESSAGE')"/>
>>               <detail/>
>>         </makefault>
>>         <send/>
>> </faultSequence>
>>
>> Then I tried sending a fault request to connector using SoapUI. As
>> response I got error message correctly but status code was always 500. How
>> can I get actual error code I have passed back to client? What is the
>> standard way?
>>
>> Thanks
>> Dimuthu
>> --
>> Dimuthu Upeksha
>> Engineering Intern
>> WSO2 inc.
>>
>> _______________________________________________
>> Dev mailing list
>> [hidden email] <http://user/SendEmail.jtp?type=node&node=96810&i=0>
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the
>> discussion below:
>>
>> http://wso2-oxygen-tank.10903.n7.nabble.com/Dev-ESB-ESB-Connector-Fault-sequence-problem-tp96810.html
>>  To start a new topic under WSO2 Development, email
>> [email protected]
>> To unsubscribe from WSO2 Development, click 
>> here<http://wso2-oxygen-tank.10903.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3&code=cmFzYWRlODhAZ21haWwuY29tfDN8LTEwNDAzODU2MTk=>
>> .
>> NAML<http://wso2-oxygen-tank.10903.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Dimuthu Upeksha
Engineering Intern
WSO2 inc.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to