<?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: Of ExceptionResolvers and XMLBeans</title>
	<atom:link href="http://www.stevideter.com/2009/02/18/of-exceptionresolvers-and-xmlbeans/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stevideter.com/2009/02/18/of-exceptionresolvers-and-xmlbeans/</link>
	<description>Technology, code, and thoughts by Stevi Deter</description>
	<lastBuildDate>Tue, 31 Aug 2010 16:12:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: regis</title>
		<link>http://www.stevideter.com/2009/02/18/of-exceptionresolvers-and-xmlbeans/comment-page-1/#comment-13447</link>
		<dc:creator>regis</dc:creator>
		<pubDate>Tue, 31 Aug 2010 16:12:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevideter.com/?p=63#comment-13447</guid>
		<description>Thank&#039;s a lot , very helpful</description>
		<content:encoded><![CDATA[<p>Thank&#8217;s a lot , very helpful</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sri</title>
		<link>http://www.stevideter.com/2009/02/18/of-exceptionresolvers-and-xmlbeans/comment-page-1/#comment-7483</link>
		<dc:creator>Sri</dc:creator>
		<pubDate>Wed, 11 Nov 2009 19:14:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevideter.com/?p=63#comment-7483</guid>
		<description>Stevi
if you have a servicefaultdocument sample that you can post that will be helpful, eventhough it&#039;s generated by beans.
this blog will be complete with that info and readers can implement any way they want.
By the way, this is absolutely a GREAT posting !!
Thanks a lot !</description>
		<content:encoded><![CDATA[<p>Stevi<br />
if you have a servicefaultdocument sample that you can post that will be helpful, eventhough it&#8217;s generated by beans.<br />
this blog will be complete with that info and readers can implement any way they want.<br />
By the way, this is absolutely a GREAT posting !!<br />
Thanks a lot !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stevi</title>
		<link>http://www.stevideter.com/2009/02/18/of-exceptionresolvers-and-xmlbeans/comment-page-1/#comment-7227</link>
		<dc:creator>stevi</dc:creator>
		<pubDate>Thu, 29 Oct 2009 15:43:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevideter.com/?p=63#comment-7227</guid>
		<description>Rosh,
In my specific case, ServiceFaultDocument is generated by &lt;a href=&quot;http://xmlbeans.apache.org/&quot; rel=&quot;nofollow&quot;&gt;XMLBeans&lt;/a&gt; from the given schema. You can give XMLBeans a try and see what it generates!</description>
		<content:encoded><![CDATA[<p>Rosh,<br />
In my specific case, ServiceFaultDocument is generated by <a href="http://xmlbeans.apache.org/" rel="nofollow">XMLBeans</a> from the given schema. You can give XMLBeans a try and see what it generates!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rosh</title>
		<link>http://www.stevideter.com/2009/02/18/of-exceptionresolvers-and-xmlbeans/comment-page-1/#comment-7222</link>
		<dc:creator>Rosh</dc:creator>
		<pubDate>Thu, 29 Oct 2009 13:00:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevideter.com/?p=63#comment-7222</guid>
		<description>Hey,
Can you please post the implementation of ServiceFaultDocument.</description>
		<content:encoded><![CDATA[<p>Hey,<br />
Can you please post the implementation of ServiceFaultDocument.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joris Vleminckx</title>
		<link>http://www.stevideter.com/2009/02/18/of-exceptionresolvers-and-xmlbeans/comment-page-1/#comment-4872</link>
		<dc:creator>Joris Vleminckx</dc:creator>
		<pubDate>Mon, 03 Aug 2009 15:57:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevideter.com/?p=63#comment-4872</guid>
		<description>New try:

&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;&lt;SOAP-ENV:Header/&gt;&lt;SOAP-ENV:Body&gt;&lt;SOAP-ENV:Fault&gt;&lt;faultcode&gt;SOAP-ENV:Server&lt;/faultcode&gt;&lt;faultstring xml:lang=&quot;en&quot;&gt;My error message&lt;/faultstring&gt;&lt;detail&gt;&lt;errorCode&gt;24&lt;/errorCode&gt;&lt;/detail&gt;&lt;/SOAP-ENV:Fault&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;</description>
		<content:encoded><![CDATA[<p>New try:</p>
<p>&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;&lt;SOAP-ENV:Header/&gt;&lt;SOAP-ENV:Body&gt;&lt;SOAP-ENV:Fault&gt;&lt;faultcode&gt;SOAP-ENV:Server&lt;/faultcode&gt;&lt;faultstring xml:lang=&quot;en&quot;&gt;My error message&lt;/faultstring&gt;&lt;detail&gt;&lt;errorCode&gt;24&lt;/errorCode&gt;&lt;/detail&gt;&lt;/SOAP-ENV:Fault&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joris Vleminckx</title>
		<link>http://www.stevideter.com/2009/02/18/of-exceptionresolvers-and-xmlbeans/comment-page-1/#comment-4871</link>
		<dc:creator>Joris Vleminckx</dc:creator>
		<pubDate>Mon, 03 Aug 2009 15:55:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevideter.com/?p=63#comment-4871</guid>
		<description>I solved it this way:

created a class extending org.springframework.ws.soap.server.endpoint.SimpleSoapExceptionResolver
and overriding the template method customizeFault() as follows to add a custom errorCode in the soapfaultdetail part:

@Override
protected void customizeFault(MessageContext messageContext, Object endpoint, Exception ex, SoapFault fault) {
	SoapFaultDetail soapFaultDetail = fault.addFaultDetail();
	Result result = soapFaultDetail.getResult();
	try {
		Transformer trn = TransformerFactory.newInstance().newTransformer();
		trn.transform(new StringSource(&quot;&quot; + ((MyException) ex).getErrorCode() + &quot;&quot;), result);
	} catch (TransformerException e) {
		e.printStackTrace();
		logger.error(&quot;Error transformando: &quot; + e.getMessage());
	}
}


This leads to the following soapfault:

SOAP-ENV:ServerMy error message24</description>
		<content:encoded><![CDATA[<p>I solved it this way:</p>
<p>created a class extending org.springframework.ws.soap.server.endpoint.SimpleSoapExceptionResolver<br />
and overriding the template method customizeFault() as follows to add a custom errorCode in the soapfaultdetail part:</p>
<p>@Override<br />
protected void customizeFault(MessageContext messageContext, Object endpoint, Exception ex, SoapFault fault) {<br />
	SoapFaultDetail soapFaultDetail = fault.addFaultDetail();<br />
	Result result = soapFaultDetail.getResult();<br />
	try {<br />
		Transformer trn = TransformerFactory.newInstance().newTransformer();<br />
		trn.transform(new StringSource(&#8220;&#8221; + ((MyException) ex).getErrorCode() + &#8220;&#8221;), result);<br />
	} catch (TransformerException e) {<br />
		e.printStackTrace();<br />
		logger.error(&#8220;Error transformando: &#8221; + e.getMessage());<br />
	}<br />
}</p>
<p>This leads to the following soapfault:</p>
<p>SOAP-ENV:ServerMy error message24</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Osman Sebati</title>
		<link>http://www.stevideter.com/2009/02/18/of-exceptionresolvers-and-xmlbeans/comment-page-1/#comment-4382</link>
		<dc:creator>Osman Sebati</dc:creator>
		<pubDate>Fri, 17 Jul 2009 14:47:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevideter.com/?p=63#comment-4382</guid>
		<description>thx again.</description>
		<content:encoded><![CDATA[<p>thx again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stevi</title>
		<link>http://www.stevideter.com/2009/02/18/of-exceptionresolvers-and-xmlbeans/comment-page-1/#comment-4379</link>
		<dc:creator>stevi</dc:creator>
		<pubDate>Fri, 17 Jul 2009 13:48:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevideter.com/?p=63#comment-4379</guid>
		<description>Osman,
Glad it was useful. 

Setting the desired endpoints in the mappedEndpoints property of the exceptionResolver should be what you need. Check out the API for AbstractEndpointExceptionResolver (parent of SoapFaultMappingExceptionResolver): 

http://static.springsource.org/spring-ws/sites/1.5/apidocs/org/springframework/ws/server/endpoint/AbstractEndpointExceptionResolver.html#setMappedEndpoints(java.util.Set)</description>
		<content:encoded><![CDATA[<p>Osman,<br />
Glad it was useful. </p>
<p>Setting the desired endpoints in the mappedEndpoints property of the exceptionResolver should be what you need. Check out the API for AbstractEndpointExceptionResolver (parent of SoapFaultMappingExceptionResolver): </p>
<p><a href="http://static.springsource.org/spring-ws/sites/1.5/apidocs/org/springframework/ws/server/endpoint/AbstractEndpointExceptionResolver.html#setMappedEndpoints(java.util.Set)" rel="nofollow">http://static.springsource.org/spring-ws/sites/1.5/apidocs/org/springframework/ws/server/endpoint/AbstractEndpointExceptionResolver.html#setMappedEndpoints(java.util.Set)</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Osman Sebati</title>
		<link>http://www.stevideter.com/2009/02/18/of-exceptionresolvers-and-xmlbeans/comment-page-1/#comment-4368</link>
		<dc:creator>Osman Sebati</dc:creator>
		<pubDate>Fri, 17 Jul 2009 06:12:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevideter.com/?p=63#comment-4368</guid>
		<description>Do you know, How can we exclude some of our endpoints,  from  this (Exception to SoapFaultDetail) mapping?

I mean, How can we expilicitely include specific endpoints to this ExceptionResolving issue?


By the way it is useful and great post. Thanx.</description>
		<content:encoded><![CDATA[<p>Do you know, How can we exclude some of our endpoints,  from  this (Exception to SoapFaultDetail) mapping?</p>
<p>I mean, How can we expilicitely include specific endpoints to this ExceptionResolving issue?</p>
<p>By the way it is useful and great post. Thanx.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: srini</title>
		<link>http://www.stevideter.com/2009/02/18/of-exceptionresolvers-and-xmlbeans/comment-page-1/#comment-3426</link>
		<dc:creator>srini</dc:creator>
		<pubDate>Tue, 23 Jun 2009 15:33:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevideter.com/?p=63#comment-3426</guid>
		<description>Thank you for sharing this! Very useful.</description>
		<content:encoded><![CDATA[<p>Thank you for sharing this! Very useful.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
