On occasion, our web services clients may send us garbage messages. 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?  We're using CXF 2.2.6. 

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)
-- 
View this message in context: 
http://old.nabble.com/Error-handling-for-invalid-Soap-body-content-tp28657740p28657740.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to