Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Exception Resolvers

  1. #1

    Default 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>

  2. #2

    Default 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.

  3. #3
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    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?
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  4. #4

    Default 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.

  5. #5
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    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".
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  6. #6

    Default Defect entered into JIRA

    Sorry it took me this long to do it, but I have created bug SWS-188 in JIRA.

  7. #7
    Join Date
    Sep 2006
    Location
    Germany
    Posts
    73

    Default

    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

  8. #8
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    The WssSoapFaultException is mapped automatically to a SOAP Fault, so you don't need to add a mapping for it.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  9. #9
    Join Date
    Sep 2006
    Location
    Germany
    Posts
    73

    Default

    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.

  10. #10
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    What is the exact client-side message and possible server-side log you get?
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •