axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stadelmann Josef" <>
Subject AW: Implement axis soap fault in server/ client side from C
Date Tue, 12 Jul 2011 08:37:04 GMT
Hi Ramesh


Hey - You are on a open source community project and that has a very big
advantage! Any time you can get sources and build it, and start a debug
session and play around.  Not worth? Well - I always learned a lot and I
have found good code I could use  in my own project as well. And that is
much worth the time spent. The sources and the debugger can help you
faster isolate faults and errors as any mails do. Well a hint is always
welcome to start digging into code. I ported years ago axis2/C to
OpenVMS and it was worth the exercise. Today I can did not only into my
server skeleton code but down into libraries like libxml2 or Axiom and
Axutil code and that has brought me many insight, and soon I will make
the same Exercise with Rampart, booth on Java as on C. Reading code like
a newspaper is what makes the difference between a beginner and a
professional. And recently I just toke the latest greatest Axis2/J
sources and loaded it in a reverse engineering cycle into the Sparx
enterprise architect CASE tool. Just to see certain relations and how
they did it. And many thing becomes clear if you do so.





Von: Nandika Jayawardana [] 
Gesendet: Montag, 11. Juli 2011 07:34
An: Apache AXIS C User List
Betreff: Re: Implement axis soap fault in server/ client side from C


Hi Ramesh,

There are two ways to return a fault from a service. You can have a look
into how the service method invocation happens by looking at
raw_xml_in_out_msg_recv.c file located at
axis2c\src\core\receivers\raw_xml_in_out_msg_recv.c. In order to return
an error, you can do following.

If you set an error status code and error message from your service
skeletons invoke method, that error message will be wrapped inside a
soap fault and will be returned to the client.

If you want to set a complete custom soap fault, you can construct a
soap envelope object and add your custom soap fault into it, and then
set it to the message context object available from the your service's
invoke method.  The message context available in the service's invoke
method is the outgoing message context and hence the soap envelope set
in the message context will be sent to the client.


On Fri, Jul 8, 2011 at 8:55 PM, Scott Wilson <>

Before giving up on using Axis2/C, I had a server returning SOAP faults
and a C# client

handling them as exceptions.  So it is possible, but I had to build from
the latest source,

and at some point a bug crept in related to faults, so then I found what
I think is the

problem and figured out how to work around it.  I found there already
was a JIRA for it

when I went to file one, so I added my workaround to it.  See



From: ramesh Gopal [] 
Sent: Friday, July 08, 2011 1:29 AM

To: Apache AXIS C User List

Subject: Re: Implement axis soap fault in server/ client side from C


Can someone pls help me with this asap ?

--- On Wed, 6/7/11, ramesh Gopal <> wrote:

From: ramesh Gopal <>
Subject: Implement axis soap fault in server/ client side from C
To: "Apache AXIS C User List" <>
Date: Wednesday, 6 July, 2011, 5:28 PM

Hello everybody,

I want to implement a logic of how to create soap fault from Axis2C in
It must follow the below format.

xmlns:soapenv="" >       



      <faultstring>There was an error in the web service</faultstring>




          <iss:errormsg>The specified table (mengano) is not in the






How do I get about coding this on the server side.

Another question I had was, how do I write my client code to understand
this soap fault and handle it.

Though this is a standard format, some services send a custom fault,
Will they also be in this format only.

Pls help me with some samples around these. Links will be an added
advantage. I googled for some samples, but havent been successful.




View raw message