Hi,
i posted my problem before in the remoting forum but it was maybe the wrong place.
http://forum.springframework.org/showthread.php?t=25001
It would be nice if someone can help me.
Cheers,
Ingo
Hi,
i posted my problem before in the remoting forum but it was maybe the wrong place.
http://forum.springframework.org/showthread.php?t=25001
It would be nice if someone can help me.
Cheers,
Ingo
I'm not sure whether it is possible with XFire. Perhaps someone else can help you with this.Originally Posted by res1st
It is possible with Spring Web Services (the topic of this forum), however. Just as you would map an exception to an error page in your web.xml or -servlet.xml application context, you can do the same with Spring Web Services.
You do so by using the SoapFaultMappingExceptionResolver. In the download is a sample airline application which shows you how to wire this up. See http://springframework.cvs.sourcefor...e=text%2Fplain, at the bottom of the file.
Cheers,
You can create XFireFault by yourselft and setup on it all information you needed to pass to client.
Just create handler class with code to convert your custom exception to XFireFault and add it to faultHandlers list of xfire instnace.
Handler can look like this :
public class MyFaultHandler extends AbstractHandler {
public void invoke(MessageContext context) throws Exception {
Exception ex = (Exception) context.getProperty(DefaultFaultHandler.EXCEPTION) ;
if( ex instanceof XFireFault){
XFireFault w = (XFireFault)ex;
String infoForClient = convertMyException( w.getCause());
w.setMessage(infoForClient);
}
}
If you are using default config - sevices.xml you need just add following to it:
<xfire>
<faultHandlers>
<handler handlerClass="com.hp.webservices.handlers.MyFaultH andler"/>
</faultHandlers>
</xfire>
Thanks for your answers.
@poutsma
I'm still considering spring-ws but it isn't released yet as a stable version and i heard to much bad things. That's why i use xfire and switch maybe later to spring-ws. But good to know how it would work with spring-ws. Thank you.
@tomeks:
Do i understand it right?
The Business logic (and therefore DAO code) is invoked by xfire and that's why all exceptions can be cached by a xfire fault handler?
Cheers,
Ingo
Last edited by res1st; May 18th, 2006 at 06:43 AM.
Yes, all exceptions thrown by your service are catched and converted to XFireFault by service invoker, which is then serialized to SOAP fault.
Can you share with us the bad things that you heard?Originally Posted by res1st
Hi Routis,
i looked some weeks ago for web service technologies and found some bad blog entries and comments. Sorry, i didn't saved the links. But then i use goolge, i quickly find things like http://radio.weblogs.com/0112098/2005/11/23.html#a542.
I also didn't understand what's the advantage using Spring-WS for me. Top-down development sounds interesting, but it's more easy to create java interfaces/classes then wsdl documents, right?
At top-down the wsdl is constant. That's nice because ws-interfaces should be stable. But if i "freeze" my Java interfaces, the generated wsdl-file should also be constant. So, i stick with programming Java instead of WSDL.
I also looked in the documentation of Spring-WS and i wasn't very satisfied with that.
Cheers,
Ingo