Return-Path: Delivered-To: apmail-ws-axis-c-user-archive@www.apache.org Received: (qmail 41975 invoked from network); 24 Aug 2007 08:47:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Aug 2007 08:47:52 -0000 Received: (qmail 5609 invoked by uid 500); 24 Aug 2007 08:47:48 -0000 Delivered-To: apmail-ws-axis-c-user-archive@ws.apache.org Received: (qmail 5598 invoked by uid 500); 24 Aug 2007 08:47:48 -0000 Mailing-List: contact axis-c-user-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C User List" Reply-To: "Apache AXIS C User List" Delivered-To: mailing list axis-c-user@ws.apache.org Received: (qmail 5587 invoked by uid 99); 24 Aug 2007 08:47:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Aug 2007 01:47:48 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jayawark@gmail.com designates 209.85.198.188 as permitted sender) Received: from [209.85.198.188] (HELO rv-out-0910.google.com) (209.85.198.188) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Aug 2007 08:47:42 +0000 Received: by rv-out-0910.google.com with SMTP id c24so538816rvf for ; Fri, 24 Aug 2007 01:47:21 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=sK62u1BpRv8meUixCLjx45Ka+gOCZ7GS1PW7UiOBfAHroxrA3Z/Lk0cQBv0mj6kXu4DcWPDPgmGfdyBpPxN+xcTXUL0W+CfnzvNoiQrkU7s9n5tRkzAj1X1zqQ9UoZQ17cHPt8/kY5lgm60qxcQ0dBL1PcJNfYdlVKh+YfEEAzE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Be1f3Dqrq/cGCevCgjNY6B9TxDqk7SnMOXM+dyX/pXXY/Um6yo9nHwEoGpMasF+mBW9+sMaFw1tZiXXxS2bq6er8ef0EZO9X0krRcprBaboxAYWhxMw2MoQ/n12DUhxXrE/aXqbJozq9vlyPjDV31kJN6ZHFg1Zew7Y7WBkFfmg= Received: by 10.141.51.15 with SMTP id d15mr1278582rvk.1187945240827; Fri, 24 Aug 2007 01:47:20 -0700 (PDT) Received: by 10.141.163.8 with HTTP; Fri, 24 Aug 2007 01:47:20 -0700 (PDT) Message-ID: <5e8118f30708240147q21b118d0gc4bf782e400f5e8a@mail.gmail.com> Date: Fri, 24 Aug 2007 14:17:20 +0530 From: "Nandika Jayawardana" To: "Apache AXIS C User List" Subject: Re: SOAP 1.1 Fault Handling In-Reply-To: <535BC169F3AFFD47926A743A46F882C83AA667@CORPUSMX60C.corp.emc.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_54324_29566893.1187945240779" References: <535BC169F3AFFD47926A743A46F882C83AA664@CORPUSMX60C.corp.emc.com> <535BC169F3AFFD47926A743A46F882C83AA667@CORPUSMX60C.corp.emc.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_54324_29566893.1187945240779 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Edward, I tested the code with soap11 fault and it works fine for me. axiom_soap_fault.h functions work for soap11 as well. Since axis2c uses a soap12 fault model soap11 'faultcode' is mapped to axiom_soap_fault_code , "faultstring" is mapped to axiom_soap_fault_reason etc. The code you have written to obtain "faultstring" is correct. You need to obtain the axiom_soap_fault from axiom_soap_body and then obtain fault reason, fault code .. from axiom_soap_fault. If your soap fault have a element then your code should work. Regards Nandika On 8/24/07, Liu_Edward@emc.com wrote: > Also, sorry for not waiting for a response, but I have tried this code > as well: > > axiom_soap_fault_reason_t* reason = > axiom_soap_fault_get_reason(soap_fault, env); > if (reason == NULL) > { > printf("\nENDING...\n"); > exit(0); > } > axiom_soap_fault_text_t* reason_text = > axiom_soap_fault_reason_get_first_soap_fault_text(reason, env); > axis2_char_t* value_text = axiom_soap_fault_text_get_text(reason_text, > env); > printf("\n%s\n", value_text); > > When I run this code, I always execute the if condition and exit early. > This is how I know that the axiom_soap_fault.h functions do not work for > a SOAP 1.1 fault message. > > -----Original Message----- > From: Liu_Edward@emc.com [mailto:Liu_Edward@emc.com] > Sent: Thursday, August 23, 2007 3:53 PM > To: axis-c-user@ws.apache.org > Subject: SOAP 1.1 Fault Handling > > I am having an issue handling a SOAP 1.1 fault. So far, I am successful > up to this point: > > axiom_soap_fault_t* soap_fault = axiom_soap_body_get_fault(soap_body, > env); > > I next run this line: > > axiom_node_t* fault_node = axiom_soap_fault_get_base_node(soap_fault, > env); > > I know that this node is not empty since I can print it out using the > axiom_node_to_string function and see this example text: > > errorError on > server > > Now the issue I am having is that I am trying to find some Axis2/C > library functions to parse this fault text, but I am having no luck with > this. I have already tried parsing fault_node using > axiom_node_get_first_child and axiom_node_get_next_sibling with success. > I have tried another method to parse fault_node, but it is not working > for me and is more desirable than the first method. When I run this > line of code: > > axiom_element_t* fault_elem = > (axiom_element_t*)axiom_node_get_data_element(fault_node, env); > > I find it that it is (null) when I print it out. I would think that by > initializing fault_node, its underlying data_element should have been > set, but it is not. Is this a bug in the library? This is a little > digression from my initial issue, so back to that... > > With the soap_fault object, I know that I can use the axiom_soap_fault.h > functions on a SOAP 1.2 object with success. However, this library does > not have any functions for parsing a SOAP 1.1 object. Is there a way > for me to parse the soap_fault object directly without creating a > fault_node object when the SOAP fault is SOAP 1.1? > > Thanks! > > --------------------------------------------------------------------- > To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org > For additional commands, e-mail: axis-c-user-help@ws.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org > For additional commands, e-mail: axis-c-user-help@ws.apache.org > > -- http://nandikajayawardana.blogspot.com/ WSO2 Inc: http://www.wso2.com ------=_Part_54324_29566893.1187945240779 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Hi Edward,

I tested the code with soap11 fault and it works fine for me. axiom_soap_fault.h functions work for soap11 as well. Since axis2c uses a soap12 fault model soap11 'faultcode' is mapped to axiom_soap_fault_code , "faultstring" is mapped to axiom_soap_fault_reason etc. The code you have written to obtain "faultstring" is correct. You need to obtain the axiom_soap_fault from axiom_soap_body and then obtain fault reason, fault code .. from axiom_soap_fault. If your soap fault have a   <faultstring></faultstring> element then your code should work.
 
Regards
Nandika
 
Also, sorry for not waiting for a response, but I have tried this code
as well:

axiom_soap_fault_reason_t* reason =
axiom_soap_fault_get_reason(soap_fault, env);
if (reason == NULL)
{
       printf("\nENDING...\n");
       exit(0);
}
axiom_soap_fault_text_t* reason_text =
axiom_soap_fault_reason_get_first_soap_fault_text(reason, env);
axis2_char_t* value_text = axiom_soap_fault_text_get_text(reason_text,
env);
printf("\n%s\n", value_text);

When I run this code, I always execute the if condition and exit early.
This is how I know that the axiom_soap_fault.h functions do not work for
a SOAP 1.1 fault message.

-----Original Message-----
From: Liu_Edward@emc.com [mailto:Liu_Edward@emc.com]
Sent: Thursday, August 23, 2007 3:53 PM
To: axis-c-user@ws.apache.org
Subject: SOAP 1.1 Fault Handling

I am having an issue handling a SOAP 1.1 fault.  So far, I am successful
up to this point:

axiom_soap_fault_t* soap_fault = axiom_soap_body_get_fault(soap_body,
env);

I next run this line:

axiom_node_t* fault_node = axiom_soap_fault_get_base_node(soap_fault,
env);

I know that this node is not empty since I can print it out using the
axiom_node_to_string function and see this example text:

<soapenv:Fault><faultcode>error</faultcode><faultstring>Error on
server</faultstring></soapenv:Fault>

Now the issue I am having is that I am trying to find some Axis2/C
library functions to parse this fault text, but I am having no luck with
this.  I have already tried parsing fault_node using
axiom_node_get_first_child and axiom_node_get_next_sibling with success.
I have tried another method to parse fault_node, but it is not working
for me and is more desirable than the first method.  When I run this
line of code:

axiom_element_t* fault_elem =
(axiom_element_t*)axiom_node_get_data_element(fault_node, env);

I find it that it is (null) when I print it out.  I would think that by
initializing fault_node, its underlying data_element should have been
set, but it is not.  Is this a bug in the library?  This is a little
digression from my initial issue, so back to that...

With the soap_fault object, I know that I can use the axiom_soap_fault.h
functions on a SOAP 1.2 object with success.  However, this library does
not have any functions for parsing a SOAP 1.1 object.  Is there a way
for me to parse the soap_fault object directly without creating a
fault_node object when the SOAP fault is SOAP 1.1?

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org




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