Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoEndpointFoundException swallowed by WebServiceMessageReceiverObjectSupport [SWS-850] #924

Closed
gregturn opened this issue Sep 26, 2013 · 2 comments
Assignees
Milestone

Comments

@gregturn
Copy link
Member

@gregturn gregturn commented Sep 26, 2013

Jarkko Rantavuori opened SWS-850 and commented

Most HTTP level exceptions, such as XML parsing issues, can be handled by writing a custom WebServiceMessageHandlerAdapter that converts them to, for example, SOAP faults. However, NoEndpointFoundException is swallowed by WebServiceMessageReceiverObjectSupport class so that it is not thrown:

catch (NoEndpointFoundException ex) {
    if (connection instanceof EndpointAwareWebServiceConnection) {
        ((EndpointAwareWebServiceConnection) connection).endpointNotFound();
    }
}

this is in final method handleConnection(), so it cannot be overridden either. Instead, a handle adapter must re-implement this whole method if NoEndpointFoundException is wanted to be converted to SOAP Fault. Either the exception should be re-thrown or there needs to be an extension point.


Affects: 2.1.3

Referenced from: commits b3964b7

@gregturn
Copy link
Member Author

@gregturn gregturn commented Sep 26, 2013

Jarkko Rantavuori commented

looks like a simple add of throw at the end of 'catch' would fix this:

catch (NoEndpointFoundException ex) {
    if (connection instanceof EndpointAwareWebServiceConnection) {
        ((EndpointAwareWebServiceConnection) connection).endpointNotFound();
    }
    throw ex;
}
@gregturn
Copy link
Member Author

@gregturn gregturn commented Feb 3, 2014

Arjen Poutsma commented

I'm afraid that rethrowing the exception is not an option, as that would break a lot of transports. The NoEndpointFoundException is meant to be dealt with by the transport.

That said, I've refactored the code so that the handling of the exception is now in a template method (WebServiceMessageReceiverObjectSupport#handleNoEndpointFoundException), which you can override in your subclass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants