How to set fault message

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to set fault message

Patrick Duflot
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