axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stadelmann Josef" <josef.stadelm...@axa-winterthur.ch>
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.

 

Josef

 

 

Von: Nandika Jayawardana [mailto:jayawark@gmail.com] 
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.

Regards
Nandika




On Fri, Jul 8, 2011 at 8:55 PM, Scott Wilson <scott.wilson945@gmail.com>
wrote:

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
AXIS2C-1499.

 

 

From: ramesh Gopal [mailto:fatuzorin2001@yahoo.com] 
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 <fatuzorin2001@yahoo.com> wrote:


From: ramesh Gopal <fatuzorin2001@yahoo.com>
Subject: Implement axis soap fault in server/ client side from C
To: "Apache AXIS C User List" <c-user@axis.apache.org>
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
C.
It must follow the below format.

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >       
  <soapenv:Body>

    <soapenv:Fault>

      <faultcode>System</faultcode>

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

      <detail>

        <iss:issues_exceptionfault>

          <iss:errorno>-206</iss:errorno>

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

        </iss:issues_exceptionfault>

      </detail>

    </soapenv:Fault>

  </soapenv:Body>

</soapenv:Envelope>

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.

Ramesh.

 

 


Mime
View raw message