You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Patrick Duflot <pd...@gmail.com> on 2010/05/03 12:03:48 UTC

How to set fault message

Hi List,

I want to set the <faultstring> element inside the <soapEnv:Fault> element
to a custom error message.

I notice the MACRO [AXIS2_ERROR_SET_MESSAGE].
I tried using this macro in my service skeleton when I catch an exception
thrown by my service implementation.
Unfortunately, the MACRO just copies the pointer to the error message and my
buffer is freed when the exception goes out of scope.

So, what is the recommended way to allocate a memory buffer and transfer its
ownership to the axis run-time ?

I had a look at the axutil_property_xxx. Is this the way to go ?

Thank you

Patrick