Announcement Announcement Module
Collapse
No announcement yet.
No endpoint mapping found: How to handle as an excpetion Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No endpoint mapping found: How to handle as an excpetion

    Hi,

    maybe this is a stupid question:
    In our project we had different versions of our webservice with different endpoint mappings.
    Now we're cleaning up and are deleting the old versions and keep only the newest version. So far so good and all works fine.
    Now I try to pass back an error response if someone - by accident - uses one of the old interface versions.
    My hope was, to "just edit" the Exception Resolver to handle this:

    Code:
    <bean id="endpointExceptionResolver" class="org.springframework.ws.soap.server.endpoint.SoapFaultMappingExceptionResolver">
            <property name="defaultFault">
                <value>RECEIVER,Server error</value>
            </property>
            <property name="exceptionMappings">
                <props>
                    <prop key="org.springframework.oxm.UnmarshallingFailureException">SENDER,Invalid request</prop>
                </props>
            </property>
        </bean>
    (Here the appropriate entry is missing, as I don't know (yet) the exact package and class name to enter here ...)

    But unfortunately, when I try to access the webservice with the wrong version, I get simply nothing. An empty response.
    In the websphere logs I found an entry like:

    Code:
    [29.12.10 13:57:42:812 CET] 00000034 EndpointNotFo W org.springframework.ws.server.MessageDispatcher dispatch No endpoint mapping found for [AxiomSoapMessage [...]
    Which gives me the idea, that this is only a warning and not an exception, so it can't be handled by the exception resolver.

    Is there a way to configure Spring framework to handle such things and pass back an "meaningfull" response ?

    Thx and best regards
    Christian

  • #2
    If i understand you well, previously you have 2 endpoints (so 2 classes)for 2 versions of the webservice.
    I thing it is normal that after removing the old one Spring send you a big warning.

    How can Spring guess that the endpoint was just removed because it is too old &that is not a enpoint not event present ?

    I i were you i will just to that in the old one
    Code:
    public class oldEnpoint{
    
    
    public MyResponse doit(MyRequest entry) {
     throw new theExceptionYouWant("Please use the new webservice...");
    }
    
    }
    & configure correctly the exception resolver.

    Comment


    • #3
      Hi,

      thanks for your reply.
      Indeed, you're right, I had two classes to handle the different versions.

      Now I removed the endpoint mappings from the config files. Everything's fine so far.
      As you said: Spring writes a warning to the logs (at least for Websphere I found one, on Weblogic I didn't find some :-(), but unfortunately it is a warning and no exception, so I cannot handle it using the Exception Handler config.

      I need to cleanup the source code to only handle the new - current - version and I need to ged rid of the old stuff.
      I didn't want to implement anything just for the case, that someone uses the old stuff. My hope was, that there is a way to tell Spring that it should create an error response to that - just like we do for any other exceptions.

      Do you have an idea ?

      Best regards
      Christian

      Comment


      • #4
        Very Helpful!

        Comment

        Working...
        X