-
Aug 14th, 2007, 04:07 PM
#1
Exception Resolvers
It is my understanding that to change the SOAP fault code or message that is associated with an exception all I should need to do is:
Configure a bean that implements EndpointExceptionResolver, in this case, an instance of the SoapFaultMappingExceptionResolver.
Specify the name of the exception and specify the Fault Code and optionally the message and language.
The MessageDispatcher should find all beans that implement this interface.
However, I have configured a bean (see below) as described , but it doesn't seem to be having any effect. I have even put a breakpoint in the resolveException method of the SoapFaultMappingExceptionResolver and it never stops there. What am I missing?
<bean id="exceptionResolver" class="org.springframework.ws.soap.server.endpoint .SoapFaultMappingExceptionResolver">
<property name="defaultFault">
<value>SERVER</value>
</property>
<property name="exceptionMappings">
<props>
<prop key="com.sun.xml.wss.impl.WssSoapFaultException">
SERVER, Invalid username or password!
</prop>
</props>
</property>
</bean>
-
Aug 14th, 2007, 04:17 PM
#2
How is exception matched?
Does the SoapFaultMappingExceptionResolver match the specified class AND any subclasses? Or does the mapping only apply if exactly that exception occurs?
Also, does the "name" property need to be set on the resolver? This is the only difference I can find between my config and the airline example, but mine does not seem to be working.
-
Aug 16th, 2007, 06:07 AM
#3
Yes, it matches subclasses as well. As for the name property on an exception resolver: it does not have one, so I am unsure what you mean.
Secondly, in the WS-Security implementation (the XwsSecurityInterceptor), we should probably catch the WssSoapFaultException, and create a Fault there. Seems like the proper thing to do. Could you create please a JIRA issue for this?
-
Aug 16th, 2007, 01:35 PM
#4
Exception Resolvers
Hi Arjen,
I misspoke ... it was late in the day and my mind was burnt. I meant the 'order' property which I assume determines the order the exception resolvers are used to resolve an exception. I didn't specify it in mine, but noticed it was there in the example. I will add it and see if it makes a difference, but I'm guessing it should not matter.
I agree that it would be nice if the Spring-WS code would detect the WS-Security exceptions like this one and create an appropriate fault. I will create a JIRA issue once I figure out how to do it ... it will be my first. 
All that said, is there any reason you can think of that my exception resolver would not have intercepted the WS-Security exception? It doesn't appear that the resolver I configure is ever invoked ... but I also don't get any errors that I can see that suggests it was configured improperly.
-
Aug 16th, 2007, 03:26 PM
#5
The order property is not required. Only if you have multiple resolvers (as in the example), and you want to indicate a preference for one.
Creating a JIRA issue is pretty simple
. Just go here: http://opensource.atlassian.com/proj...ing/browse/SWS, create a login, and choose "Create New Issue".
-
Sep 5th, 2007, 08:31 AM
#6
Defect entered into JIRA
Sorry it took me this long to do it, but I have created bug SWS-188 in JIRA.
-
Nov 16th, 2007, 06:31 AM
#7
I'm using Spring-WS Version 1.0.2 but I still can not map the wsse exceptions.
JIRA states it should have been fixed with ws 1.0.1
Does anybody know the trick?
Thanks,
Robert
-
Nov 16th, 2007, 08:05 AM
#8
The WssSoapFaultException is mapped automatically to a SOAP Fault, so you don't need to add a mapping for it.
-
Nov 17th, 2007, 12:02 PM
#9
Arjen,
thanks for your reply. I appreciate your whole work.
I'm fairly new to webservices.
I want to map wsse failures to a generic message like "authentication failed".
Also, in SoapUI I receive a "missing fault" warning when authentication fails.
-
Nov 19th, 2007, 06:56 PM
#10
What is the exact client-side message and possible server-side log you get?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules