Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2824

Error handling improvements for invalid Soap message content

    XMLWordPrintableJSON

Details

    Description

      Soap web services clients may send garbage or invalid messages to our CXF jaxws web service. For example, the message may consist of a valid soap envelope, but the soap body is empty. On other occasions, the soap body contains non-xml content.

      CXF gets nullpointer exceptions in these cases, and returns a generic Soap fault, "Fault occurred while processing". Shouldn't the framework be able to provide a more useful message, such as "malformed xml content", and not fail on a nullpointer exception?

      Below is a stack trace generated for a Soap Envelope containing an empty body:
      <soapenv:Header/>
      <soapenv:Body></soapenv:Body>

      WARNING: Interceptor

      {http://hello.com/soarian/hello_v1}

      Hello_v1Servicehas thrown exception, unwinding now
      java.lang.NullPointerException
      at org.apache.cxf.frontend.SimpleMethodDispatcher.getMethod(SimpleMethodDispatcher.java:96)
      at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:57)
      at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
      at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
      at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
      at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:312)
      at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
      at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:326)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:930)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            easternwahoo EasternWahoo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: