2 Replies Latest reply on Sep 27, 2013 3:58 AM by Magesh Bojan

    SOAPProcessor.getMessage() returns null instead of the curre

    Philippe Schrettenbrunner Newbie

      I am currently trying to expose a local WebService as an JBossWS WebService (ESB aware) on the ESB (mainly, because the ESB can be seen from the outside world whereas the local WebService is only available on the internal network). The goal is to accept the WebSericve call on the ESB, inspect the message (do some logic, if necessary) and finally call the actual non-ESB WebService.

      To access the message I am using the SOAPProcessor in the same way it is used in the Quickstart examples (webservice_producer):

      Message message = SOAPProcessor.getMessage();
       System.out.println("Message: " + message.getBody().get());


      However, SOAPProcessor.getMessage() returns null all the time and thus the second line throws a NullPointerException.
      Unfortunately, I am also getting 'null' with the webservice_producer Quickstart code. I deployed it with an 'ant deploy' and invoked the sayGoodby operation using the 'Web Service Explorer' from Eclipse.

      From the server log:

      12:00:24,015 INFO [WSDLFilePublisher] WSDL published to: file:/C:/Programme/Server/jboss-soa-p.4.3.0/jboss-as/server/phil/data/wsdl/Quickstart_webservice_producer.esb/Quickstart_webservice_producer.war/GoodbyeWorldWSService30959763312875877.wsdl
      12:18:53,578 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
      java.lang.NullPointerException
       at org.jboss.soa.esb.samples.quickstart.webserviceproducer.webservice.GoodbyeWorldWS.sayGoodbye(GoodbyeWorldWS.java:26)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:592)
       at org.jboss.wsf.container.jboss42.DefaultInvocationHandler.invoke(DefaultInvocationHandler.java:102)
       at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:223)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:421)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:286)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:196)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:122)
       at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      

      The NullPointerExceptions shows up because I removed the "if (esbMessage != null)" statement.

      What do I have to change (configuration?) to get the actual message back from the SOAPProcessor?

      Thank you in advance,
      Phil