3 Replies Latest reply on Dec 15, 2015 7:07 AM by Mustafa Musaji

    How to add parameter to service endpoint interface url?

    Joseph Hwang Novice

      These codes are my SEI

       

      @WebService(targetNamespace=http://www.aaa.com)
      public interface ICallMemberPort {

      @WebMethod
      @WebResult
      List<Member> getMember(@WebParam String id);
      }

       

      Implementation of this services have no problem. Below url returns the right WSDL.

      http://localhost:8080/ExtjsSOAPWeb/CallMemberBean?wsdl

       

      I try to invoke this SEI with url form.

      http://localhost:8080/ExtjsSOAPWeb/CallMemberBean?operation=ICallMemberPort

       

      But this url throws the exceptions

      15:46:42,782 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (default task-2) Interceptor for {http://www.aaa.com}CallMemberBeanService has thrown exception, unwinding now: java.lang.NullPointerException

      at org.apache.cxf.binding.soap.saaj.SAAJUtils.getHeader(SAAJUtils.java:42)

      at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.createProtocolMessageContext(SOAPHandlerInterceptor.java:261)

      at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessageInternal(SOAPHandlerInterceptor.java:161)

      at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:124)

      at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:71)

      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)

      at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)

      at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:241)

      at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:97)

      at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:131)

      at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:88)

      at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)

      at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:211)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]

      at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:136)

      at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140) [jbossws-spi-2.3.1.Final.jar:2.3.1.Final]

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]

      at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]

      at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [undertow-core-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]

      at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:248) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:77) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:167) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199) [undertow-core-1.1.8.Final.jar:1.1.8.Final]

      at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:761) [undertow-core-1.1.8.Final.jar:1.1.8.Final]

      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_51]

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_51]

      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_51]

       

      Do you think the SEI invocation url http://localhost:8080/ExtjsSOAPWeb/CallMemberBean?operation=ICallMemberPort has some problem? If nullpoint exception is due to no parameter of SEI,

      pls, inform me how to add parameter to SEI.

      You advice will be deeply appreciated! Thanks

        • 1. Re: How to add parameter to service endpoint interface url?
          Jim Ma Apprentice

          Why do you need this parameter ? And invocation doesn't require any extra parameter to declare the web service endpoint and operation.

          • 2. Re: How to add parameter to service endpoint interface url?
            Joseph Hwang Novice

            Thank you for reply.

            My client codes are made with ExtJS 5.0. In ExtJS, soap web services are called with soap url like below,

             

            var family = Ext.create('Ext.data.Store' , {

             

              model : 'Member',

              autoLoad : true,

              proxy : {

                        type : 'soap',

                        url : 'CallMemberBean',

                        api : {

                    read: 'getMember'

                    },

                  soapAction : {

                    read : 'http://localhost:8080/<WEB_PROJECT>'

                  },

                  operationParam : 'operation',

                  targetNamespace : 'http://www.aaa.com',

                  reader : {

                    type : 'xml',

                    record : 'ns|return',

                    namespace : 'ns'

                   },

                   exception: function(proxy, response, operation){

                            Ext.MessageBox.show({

                                title: 'REMOTE EXCEPTION',

                                msg: operation.getError(),

                                icon: Ext.MessageBox.ERROR,

                                buttons: Ext.Msg.OK

                            });

                        }

             

            The above ExtJS codes produce the following SOAP url

            http://localhost:8080/<WEB_PROJECT>/CallMemberBean?operation=getMember

            But this url throws the exception 'Internal Server Error 500'. So if SOAP url can invoke the server sei, I want to know the correct soap url.

            Best Regards!

            • 3. Re: How to add parameter to service endpoint interface url?
              Mustafa Musaji Novice

              According to the ExtJS documentation Ext JS Guides | SOAP Services you need to create a ext.data.model Ext JS - Sencha Docs to get the data store up and running. I.e. this maps your endpoint to the ExtJS system I think. However, if you read the docs it says

               

              "If you need to communicate with a remote SOAP service, you will have to create a server-side proxy on your server that fetches and returns the SOAP response from the remote server."

               

              From a ExtJS perspective I don't know what really means. Perhaps you should cross post this question on the ExtJS forums. It really sounds like ExtJS should be used to quickly expose SOAP endpoints and consume them using ExtJS clients.