Hello,

I read your links but they don't solved my problem. Maybe I've done something wrong - so I explain exactly what I'm doing. In the service I implemented what I've found in Jira AXIS2C-678 (https://issues.apache.org/jira/browse/AXIS2C-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel) and the echo example of the c server implementation. I implemented a custom error message method:

void set_custom_error(const axutil_env_t *env, axis2_char_t *error_message)
       {
         axutil_error_set_error_message(env->error, error_message);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_LAST + 1, AXIS2_FAILURE);
       }

and call it from the service method. But then there is no custom error message delivered to the client. I only found the custom message in the log file of the axis server where it is not reachable from the client. I also monitored the SOAP messages and the custom error message is not inside the response:

<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";><soapenv:Header/><soapenv:Body><fault>TestService|http://auger.fzk.org failed</fault></soapenv:Body></soapenv:Envelope>

With this response message the java client throws no exception. I found that the response is exactly what the on_fault method of the service creates.

I also read the link from Samisa (http://www.nabble.com/Help-needed-on-building-custom-soap-fault-in-axis2c-tf4538948.html#a13053097) but it has another content - I think. In the link the wsdl has defined two exceptions and the author wanted to know how to use them. The solution was to implement them in the on_fault method.

Now to my questions: Have I done something wrong in the implementation of the service or is it not possible to send custom error messages to the client with my custom error method? Or have I always to define the exceptions in the wsdl and implement them in the on_fault method of the service?

I have attached my service - maybe someone can help me.

Kind regards
Michael

Samisa Abeysinghe wrote:
Subra A Narayanan wrote:
Michael,

If you are setting the soap fault correctly on your server side, your
java client when it receives the soap response back with the soap
fault in it, should automatically throw an exception. You can then
retrieve the exception using ex.message.

May be someone from the Axis2 team can correct me if I am wrong.
You are absolutely correct.
BTW, please follow this thread for further information: http://www.nabble.com/Help-needed-on-building-custom-soap-fault-in-axis2c-tf4538948.html#a13053097

Thanks,
Samisa...


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Attachment: axisTest.tar.gz
Description: GNU Zip compressed data

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to