axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nandika Jayawardana <jayaw...@gmail.com>
Subject Re: Axis2C Soap Exception Handling
Date Fri, 03 Sep 2010 05:08:37 GMT
Hi Thomas,
It seems there is an issue. Can you raise a jira issue for this.

Regards
Nandika


On Wed, Sep 1, 2010 at 11:50 PM, Thomas S <thomass462@gmail.com> wrote:

> I am currently working on porting a C++ soap client from the rather aged MS
> Soap Toolkit to Axis2C.
> To start with this will run on Windows but part of the exercise is to get
> our system ported to Linux.
> For the most part the port was fairly straight-forward and I am getting
> good results with my unit tests.
>
> However, there is one situation I haven't quite figured out yet - handling
> of Soap Faults.
>
> My unit test "SoapExceptionsService" returns the following (taken from
> SoapUI output).
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
> http://www.w3.org/2001/XMLSchema">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode xmlns:q0="http://www.cc.com/SoapExceptionService
> ">q0:SoapExceptionService</faultcode>
>          <faultstring>System.Web.Services.Protocols.SoapException: This is
> the FaultString
>    at SoapExceptionService.Service1.HelloWorld(RequestInput
> ri)</faultstring>
>          <faultactor>http://www.cc.com/SoapExceptionService</faultactor>
>          <detail>
>             <DetailMessage>This is the Detail section</DetailMessage>
>          </detail>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
>
> Using the MS Soap Toolkit there are methods returning all the separate
> pieces of the exception:
>
> FaultActor         = "http://www.cc.com/SoapExceptionService"
> FaultCode         = "SoapExceptionService"
> FaultCodeNamespace     = "http://www.cc.com/SoapExceptionService"
> FaultDetail         = "<detail><DetailMessage>This is the Detail
> section</DetailMessage></detail>"
> FaultString         = "System.Web.Services.Protocols.SoapException: This is
> the FaultString
>                    at SoapExceptionService.Service1.HelloWorld(RequestInput
> ri)"
>
> However, using Axis2C (I tried both 1.6 and latest 1.7 code from SVN) only
> returns a subset of these fields.
>
> Fault Code: (null)
> Exception: (null)
> Reason: (null)
> Role: http://www.cc.com/SoapExceptionService
> Detail xml: <detail><DetailMessage>This is the Detail
> section</DetailMessage></detail>
>
> If I retrieve the fault base node and serialize it I see the whole fault
> message so Axis has all the data available.
> I stepped through function axiom_soap_body_convert_fault_to_soap11() and it
> appears that the values are found and text elements are created for the
> missing items but when I try to retrieve them using the axis functions the
> string values end up being NULL.
>
> Example:
>
>                 axis2_char_t *strcodevalue = "";
>                 ::axiom_soap_fault_code *fcode =
> ::axiom_soap_fault_get_code(fault, env);  // returns ok value
>                 if (fcode) {
>                     ::axiom_soap_fault_value *fcodevalue =
> ::axiom_soap_fault_code_get_value(fcode, env);  // returns ok value
>                     if (fcodevalue) {
>                         strcodevalue =
> ::axiom_soap_fault_value_get_text(fcodevalue, env);  // return NULL
>                     }
>                 }
>
> I suppose I could manually parse the fault xml but I'd kinda prefer to let
> the Soap library handle these details.
>
> Am I missing something here or just plain oversimplifying things? Any
> pointers would be appreciated.
>
> Many thanks in advance,
> Thomas
>



-- 
http://nandikajayawardana.blogspot.com/
WSO2 Inc: http://www.wso2.com

Mime
View raw message