axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Sutter <>
Subject Re: custom error message with c server
Date Tue, 13 Nov 2007 11:03:15 GMT

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 

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:



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 

I also read the link from Samisa 

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 

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

Kind regards

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: 

> Thanks,
> Samisa...
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message