axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Samisa Abeysinghe (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (AXIS2C-678) Ability to return custom error codes/messages to client
Date Tue, 04 Sep 2007 08:18:58 GMT

     [ https://issues.apache.org/jira/browse/AXIS2C-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Samisa Abeysinghe resolved AXIS2C-678.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.0
         Assignee: Samisa Abeysinghe

I have fixed this. This is what you have to do.

1. define an 'on_fault' method in the service skeleton
2. In the function implementing business logic, when an error occures, do the following
    2.1. axutil_error_set_error_message(env->error, "your custom error message");
    2.2. AXIS2_ERROR_SET(env->error, AXIS2_ERROR_LAST + 1, AXIS2_FAILURE);
    2.3. return NULL

In step 2.2., setting the error code to AXIS2_ERROR_LAST + 1 means that the error is a user
defined one and that it has to pick the error form user set error message.

I have updated the echo service sample to demonstrate this solution.

You can test this by commenting the line 
axiom_element_set_text(text_om_ele, env, "Hello World!", text_om_node); 
in the build_om_payload_for_echo_svc function of the echo client sample

> Ability to return custom error codes/messages to client
> -------------------------------------------------------
>
>                 Key: AXIS2C-678
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-678
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: util
>            Reporter: Subra A Narayanan
>            Assignee: Samisa Abeysinghe
>             Fix For: 1.1.0
>
>
> Having a way to return custom error codes/messages to client would be a big plus. This
way the client would know where exactly the error lies, on the server side or in the request
itself.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Mime
View raw message