Announcement Announcement Module
Collapse
No announcement yet.
XPathPayloadEndpointMapping - handling invalid XML Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XPathPayloadEndpointMapping - handling invalid XML

    Hi, i'm using XPathPayloadEndpointMapping to route POX messages to specific endpoints. If the request contains invalid xml i currently get a

    Code:
    org.xml.sax.SAXParseException: Content is not allowed in prolog.
            at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
            at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
            at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
            at org.springframework.ws.pox.dom.DomPoxMessageFactory.createWebServiceMessage(DomPoxMessageFactory.java:87)
            at org.springframework.ws.transport.AbstractWebServiceConnection.receive(AbstractWebServiceConnection.java:86)
            at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:86)
            at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
            at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:230)
            at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
            at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
    I'd like to be able to handle this in a more elegant manner. I've looked at using a custom interceptor, but the documentation states that the interceptor...

    "Processes the incoming request message. Called after EndpointMapping determined an appropriate endpoint object, but before EndpointAdapter invokes the endpoint. "

    ... which would be too late in the chain since XPathPayloadEndpointMapping would have already tried to run an xpath query on the incoming request.

    I also thought about using an ExceptionResolver, but the supplied classes only seem to support SOAP (as opposed to POX).

    Any ideas about this?

    Thanks.
Working...
X