<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Code Generate Custom SOAP Faults For Axis2/C</title>
	<atom:link href="http://www.dimuthu.org/blog/2009/02/09/code-generate-custom-soap-faults-for-axis2c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dimuthu.org/blog/2009/02/09/code-generate-custom-soap-faults-for-axis2c/</link>
	<description>Waiting for your comments</description>
	<lastBuildDate>Thu, 01 Dec 2011 06:50:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Jaime Casero</title>
		<link>http://www.dimuthu.org/blog/2009/02/09/code-generate-custom-soap-faults-for-axis2c/comment-page-1/#comment-58434</link>
		<dc:creator>Jaime Casero</dc:creator>
		<pubDate>Thu, 17 Mar 2011 15:00:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=916#comment-58434</guid>
		<description>good to know the gen tool is supporting this scenario now.

I&#039;m using Axis2Java 1.5.4 to compile my WSDL, the code generated doesn&#039;t include the third parameter about the fault, some option for the compiler needed?

So,I had to use a ThreadLocal technique to simulate this feature. In the business logic section i added the custom error to the current thread, using the pthread lib, then i returned NULL (pretty the same as the example, replacing the AXIS2_ERROR_SET call with my own threadlocal utility). 

Then, going back into the skel interface you have to override the on_fault callback like this:
axiom_node_t* AXIS2_CALL
axis2_svc_skel_SystemServicesService_on_fault(axis2_svc_skeleton_t *svc_skeleton,
        const axutil_env_t *env, axiom_node_t *node) {

    axiom_node_t * retNode = NULL;
    retNode = CSTAErrorManager::getReference().getError();
    //retNode = adb_ErrorValue_serialize(eValue, env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
    axiom_node_add_child (node, env, retNode);
    return retNode;
}

hope this helps someone.</description>
		<content:encoded><![CDATA[<p>good to know the gen tool is supporting this scenario now.</p>
<p>I&#8217;m using Axis2Java 1.5.4 to compile my WSDL, the code generated doesn&#8217;t include the third parameter about the fault, some option for the compiler needed?</p>
<p>So,I had to use a ThreadLocal technique to simulate this feature. In the business logic section i added the custom error to the current thread, using the pthread lib, then i returned NULL (pretty the same as the example, replacing the AXIS2_ERROR_SET call with my own threadlocal utility). </p>
<p>Then, going back into the skel interface you have to override the on_fault callback like this:<br />
axiom_node_t* AXIS2_CALL<br />
axis2_svc_skel_SystemServicesService_on_fault(axis2_svc_skeleton_t *svc_skeleton,<br />
        const axutil_env_t *env, axiom_node_t *node) {</p>
<p>    axiom_node_t * retNode = NULL;<br />
    retNode = CSTAErrorManager::getReference().getError();<br />
    //retNode = adb_ErrorValue_serialize(eValue, env, NULL, NULL, AXIS2_TRUE, NULL, NULL);<br />
    axiom_node_add_child (node, env, retNode);<br />
    return retNode;<br />
}</p>
<p>hope this helps someone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dimuthu</title>
		<link>http://www.dimuthu.org/blog/2009/02/09/code-generate-custom-soap-faults-for-axis2c/comment-page-1/#comment-29854</link>
		<dc:creator>dimuthu</dc:creator>
		<pubDate>Sun, 29 Aug 2010 01:12:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=916#comment-29854</guid>
		<description>Hi,
You have to set AXIS2_ERROR_SET method with the error code and fault-&gt;your_excpetion_name with your exception object. In the tutorial it is shown in like this,
          /* 1. Creating the adb object and set it to the fault pointer variable */
          adb_MyFirstException_t *exp = NULL;
          exp = adb_MyFirstException_create(env);
          adb_MyFirstException_set_text(exp, env, &quot;this is the exception 1&quot;); /* custom value */

          fault-&gt;MyFirstException = exp;

          /* 2. Setting the error constant corrosponding to the fault */
          AXIS2_ERROR_SET(env-&gt;error,
                      AXIS2_SKEL_MYSERVICE_MYOPERATION_FAULT_MYFIRSTEXCEPTION,
                      AXIS2_FAILURE);

          /* 3. Returning NULL */
          return NULL;

Got it?
Dimuthu</description>
		<content:encoded><![CDATA[<p>Hi,<br />
You have to set AXIS2_ERROR_SET method with the error code and fault-&gt;your_excpetion_name with your exception object. In the tutorial it is shown in like this,<br />
          /* 1. Creating the adb object and set it to the fault pointer variable */<br />
          adb_MyFirstException_t *exp = NULL;<br />
          exp = adb_MyFirstException_create(env);<br />
          adb_MyFirstException_set_text(exp, env, &#8220;this is the exception 1&#8243;); /* custom value */</p>
<p>          fault-&gt;MyFirstException = exp;</p>
<p>          /* 2. Setting the error constant corrosponding to the fault */<br />
          AXIS2_ERROR_SET(env-&gt;error,<br />
                      AXIS2_SKEL_MYSERVICE_MYOPERATION_FAULT_MYFIRSTEXCEPTION,<br />
                      AXIS2_FAILURE);</p>
<p>          /* 3. Returning NULL */<br />
          return NULL;</p>
<p>Got it?<br />
Dimuthu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dimuthu</title>
		<link>http://www.dimuthu.org/blog/2009/02/09/code-generate-custom-soap-faults-for-axis2c/comment-page-1/#comment-29853</link>
		<dc:creator>dimuthu</dc:creator>
		<pubDate>Sun, 29 Aug 2010 01:08:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=916#comment-29853</guid>
		<description>Hi,
Can you trace and check the details element present in your soap message?
Dimuthu</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Can you trace and check the details element present in your soap message?<br />
Dimuthu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: balaji</title>
		<link>http://www.dimuthu.org/blog/2009/02/09/code-generate-custom-soap-faults-for-axis2c/comment-page-1/#comment-27355</link>
		<dc:creator>balaji</dc:creator>
		<pubDate>Mon, 19 Jul 2010 20:10:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=916#comment-27355</guid>
		<description>just to add to it,
I understand that to create a axis fault using axis2c i need to set the fault element using AXIS2_HANDLE_ERROR and just return NULL from business logic. I assume now, axis2c would create SOAP fault using the error message that the AXIS2_HANDLE_ERROR had set . 

So it should pass the fault message to my java layer and Java layer has to recoginse it has axis fault and output the error message accordingly.
But what i see in tomcat logs are the following (which tells the axis2fault created by axis2c is lost and just NULL is returned.So how to I pass the fault information to Java side.

 at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(Ou    tInAxisOperation.java:370)
  at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOpe    ration.java:416)
  at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutIn    AxisOperation.java:228)
   at org.apache.axis2.client.OperationClient.execute(OperationClient.java:16    3)
   at WSAmplify_v2_1ServiceStub.test(WSAmplify_v2_1    ServiceStub.java:2144)</description>
		<content:encoded><![CDATA[<p>just to add to it,<br />
I understand that to create a axis fault using axis2c i need to set the fault element using AXIS2_HANDLE_ERROR and just return NULL from business logic. I assume now, axis2c would create SOAP fault using the error message that the AXIS2_HANDLE_ERROR had set . </p>
<p>So it should pass the fault message to my java layer and Java layer has to recoginse it has axis fault and output the error message accordingly.<br />
But what i see in tomcat logs are the following (which tells the axis2fault created by axis2c is lost and just NULL is returned.So how to I pass the fault information to Java side.</p>
<p> at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(Ou    tInAxisOperation.java:370)<br />
  at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOpe    ration.java:416)<br />
  at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutIn    AxisOperation.java:228)<br />
   at org.apache.axis2.client.OperationClient.execute(OperationClient.java:16    3)<br />
   at WSAmplify_v2_1ServiceStub.test(WSAmplify_v2_1    ServiceStub.java:2144)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: balaji</title>
		<link>http://www.dimuthu.org/blog/2009/02/09/code-generate-custom-soap-faults-for-axis2c/comment-page-1/#comment-27354</link>
		<dc:creator>balaji</dc:creator>
		<pubDate>Mon, 19 Jul 2010 19:39:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=916#comment-27354</guid>
		<description>hi dimuthu
I need to pass the axis2c fault from C side to java side (tomcat).
Currently what i do is:
adb_test response =NULL;
AXIS2_HANDLE_ERROR(env,
                     AXIS2_ERROR_REPOS_BAD_SEARCH_TEXT,
                        AXIS2_FAILURE);
               
return response;

what i see at the end is : org.apache.axis2.AxisFault: Data element of the OM Node is NULL.

What i want is my error that i have set (AXIS2_ERROR_REPOS_BAD_SEARCH_TEXT) at the C level?</description>
		<content:encoded><![CDATA[<p>hi dimuthu<br />
I need to pass the axis2c fault from C side to java side (tomcat).<br />
Currently what i do is:<br />
adb_test response =NULL;<br />
AXIS2_HANDLE_ERROR(env,<br />
                     AXIS2_ERROR_REPOS_BAD_SEARCH_TEXT,<br />
                        AXIS2_FAILURE);</p>
<p>return response;</p>
<p>what i see at the end is : org.apache.axis2.AxisFault: Data element of the OM Node is NULL.</p>
<p>What i want is my error that i have set (AXIS2_ERROR_REPOS_BAD_SEARCH_TEXT) at the C level?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dimuthu</title>
		<link>http://www.dimuthu.org/blog/2009/02/09/code-generate-custom-soap-faults-for-axis2c/comment-page-1/#comment-17404</link>
		<dc:creator>dimuthu</dc:creator>
		<pubDate>Mon, 04 Jan 2010 02:11:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=916#comment-17404</guid>
		<description>Hi,
As I remember people was working on Axis2/Java 1.5 release in a different branch. So most probably this will not be in that release. :( That mean you have to get it from source.
Thanks
Dimuthu</description>
		<content:encoded><![CDATA[<p>Hi,<br />
As I remember people was working on Axis2/Java 1.5 release in a different branch. So most probably this will not be in that release. <img src='http://www.dimuthu.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  That mean you have to get it from source.<br />
Thanks<br />
Dimuthu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: domv</title>
		<link>http://www.dimuthu.org/blog/2009/02/09/code-generate-custom-soap-faults-for-axis2c/comment-page-1/#comment-17391</link>
		<dc:creator>domv</dc:creator>
		<pubDate>Sun, 03 Jan 2010 21:33:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=916#comment-17391</guid>
		<description>Hi Dimuthu,

Many thx for your articles.
Very helpful when dealing with axis2c.
Is the fault exception handling available in axis2/Java 1.5.1 codegen or do I have to get it from the sources ?

Dom V.</description>
		<content:encoded><![CDATA[<p>Hi Dimuthu,</p>
<p>Many thx for your articles.<br />
Very helpful when dealing with axis2c.<br />
Is the fault exception handling available in axis2/Java 1.5.1 codegen or do I have to get it from the sources ?</p>
<p>Dom V.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: robgarv</title>
		<link>http://www.dimuthu.org/blog/2009/02/09/code-generate-custom-soap-faults-for-axis2c/comment-page-1/#comment-13852</link>
		<dc:creator>robgarv</dc:creator>
		<pubDate>Sun, 25 Oct 2009 16:20:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=916#comment-13852</guid>
		<description>Hi Dimuthu,

Great article. Been having to learn Axis2/C in a hurry and have found your writings on it quite useful. Just thought I would take a minute during rebuilds to tell ya that. 

Rob G.</description>
		<content:encoded><![CDATA[<p>Hi Dimuthu,</p>
<p>Great article. Been having to learn Axis2/C in a hurry and have found your writings on it quite useful. Just thought I would take a minute during rebuilds to tell ya that. </p>
<p>Rob G.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dimuthu</title>
		<link>http://www.dimuthu.org/blog/2009/02/09/code-generate-custom-soap-faults-for-axis2c/comment-page-1/#comment-5839</link>
		<dc:creator>dimuthu</dc:creator>
		<pubDate>Thu, 16 Apr 2009 16:23:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=916#comment-5839</guid>
		<description>Hi,
You can check a test cases to the wsdl and generated files from this jira, &lt;a href=&quot;https://issues.apache.org/jira/browse/AXIS2C-1344&quot; rel=&quot;nofollow&quot;&gt;https://issues.apache.org/jira/browse/AXIS2C-1344&lt;/a&gt;. Make sure your generated code is same as that.
Or probably there may be old jars in the classpath.

Thanks
Dimuthu</description>
		<content:encoded><![CDATA[<p>Hi,<br />
You can check a test cases to the wsdl and generated files from this jira, <a href="https://issues.apache.org/jira/browse/AXIS2C-1344" rel="nofollow">https://issues.apache.org/jira/browse/AXIS2C-1344</a>. Make sure your generated code is same as that.<br />
Or probably there may be old jars in the classpath.</p>
<p>Thanks<br />
Dimuthu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: robert</title>
		<link>http://www.dimuthu.org/blog/2009/02/09/code-generate-custom-soap-faults-for-axis2c/comment-page-1/#comment-5838</link>
		<dc:creator>robert</dc:creator>
		<pubDate>Thu, 16 Apr 2009 16:17:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=916#comment-5838</guid>
		<description>Hi!

You wrote: 

&quot;Note that this feature is available only in the very latest WSDL2C tool. Try to get latest build from Axis2/Java to use this up to date tool.&quot;

I checked out axis2 version 1.5, but i cannot create such code you explained above. Is it possible to write down step-by-step how did you generate the code and which version of WSDL2C was used?

Thanks your help, br,

robert.</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>You wrote: </p>
<p>&#8220;Note that this feature is available only in the very latest WSDL2C tool. Try to get latest build from Axis2/Java to use this up to date tool.&#8221;</p>
<p>I checked out axis2 version 1.5, but i cannot create such code you explained above. Is it possible to write down step-by-step how did you generate the code and which version of WSDL2C was used?</p>
<p>Thanks your help, br,</p>
<p>robert.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

