11 Replies Latest reply on Nov 9, 2011 5:16 AM by mpalvankar

    Unable to resolve package javax.xml.rpc

    mpalvankar

      Hi All

       

      I have a web service on FUSE ESB which needs to invoke external web service (JasperServer). The external web service WSDL uses RPC/encoded.

       

      I generated proxy classes using jaxrpc.jar and trying to use the proxy from the web service on FUSE ESB. I have added a dependecy on jaxrpc,

       

       

      and also imported the package javax.xml.rpc.

       

      But when I deploy the web service bundle, the bundle does not start. On trying to explicitly start the bundle, I get an error as:

       

      Unresolved constraint in bundle runreport-service-interface-impl : Unable to resolve 339.0: missing requirement package; (package=javax.xml.rpc)

       

      Is there anything that I am missing?

        • 1. Re: Unable to resolve package javax.xml.rpc
          ffang

          Hi,

           

          There's no bundle in FUSE ESB by default export javax.xml.rpc package, so you need install a bundle which  export javax.xml.rpc package yourself.

          Btw, Cxf doesn't suppport RPC/ENCODED(this is quite old spec and has several drawbacks so AFAIK no modern webservice stack suppport it, only Axis 1 support it but Axis 1 doesn't get updated about 5 years) so you can't use CXF as the proxy client(also can't use any component which leverage CXF such as camel-cxf and servicemix-cxf-bc)

           

          Freeman

          • 2. Re: Unable to resolve package javax.xml.rpc
            mpalvankar

            Thanks for the reply.

             

            As you have rightly mentioned, I was able to resolve the jax-rpc dependency by deploying jaxrpc-api-osgi-1.1-b01.jar.

             

            I also deployed axis bundle axis-1.4-osgi but I could not strat the bundle as its failing due to dependency on com.sun.jimi.core.

             

            Before I install all the required bundles of Axis, I wanted to know if it is possible to create a Provider BC (without using CXF) for the external web service which uses rpc/encoding.

            • 3. Re: Unable to resolve package javax.xml.rpc
              ffang

              Hi,

               

              Of course you can create a bindingcomponent which support rpc/encoded yourself, but the question here is you really need it? As it's not a simple task and we encourage to use camel but not JBI now.

               

              You can actually put the axis proxy into a bean and deploy it as OSGi bundle OR put the bean in camel router, camel has powerful ways to invoke a bean.

               

              Freeman

              • 4. Re: Unable to resolve package javax.xml.rpc
                mpalvankar

                Thanks Freeman.

                 

                Confirming my understanding so that I can go ahead to implement the same.

                 

                1. Create a separate OSGI bundle using generated proxy classes of external web service.

                2. Install Axis OSGI bundle with all the required packages.

                3. Invoke the #1 bundle using Camel Router which will invoke the external web service

                 

                Correct me if my undertsanding is incorrect.

                • 5. Re: Unable to resolve package javax.xml.rpc
                  ffang

                  Hi,

                   

                  Yes, that's correct.

                   

                  Freeman

                  • 6. Re: Unable to resolve package javax.xml.rpc
                    mpalvankar

                    The given solution is not working. This is what I did.

                     

                    1. Generated proxy for external web service using axis 1.3 as the external webservice uses RPC/encoding.

                     

                    2. Created a bundle with a bean and the generated proxy classes.

                     

                    3. Installed required packages of bundle #2.

                     

                    4. Registered the bundle in blueprint container with init-method. The init method sends a soap request to external webservice using the generated proxy/stub classes.

                     

                     

                     

                    After deploying this bundle, the init method gets invoked but waits forever for external web service invocation.

                     

                    Is there anything missing?

                    • 7. Re: Unable to resolve package javax.xml.rpc
                      ffang

                      Hi,

                       

                      Do you mean the init method invoke the proxy to send out soap request? That's a little bit weird for me, as the init method generally should only do some "init" task and later on other bean can hold the reference of the proxy to invoke external webservice.

                      Anyway could you use some tool like tcpdump to dump the onwire soap request/response which can give you more details.

                      And you can also add some log in the external webservice which can tell the service is really get invoked.

                       

                      Freeman

                      • 8. Re: Unable to resolve package javax.xml.rpc
                        mpalvankar

                        The init method was only for quick testing of the SOAP request call to external service. And its not possible to change the external service for adding any logs.

                         

                        I also tried the Camel routing approach and the external web service is getting invoked.

                         

                        Howver I still wanted to figure out the issues with first approach with out Camel routing. I will try and use tools like tcpdump or tcpmon and check for any issue.

                         

                        I just wanted to confirm if I have not missed anything in the first approach.

                        • 9. Re: Unable to resolve package javax.xml.rpc
                          mpalvankar

                          Invoking the external web service (RPC/encoded) usinf camel route is resulting in SOAP Fault.

                          -


                          AxisFault

                          faultCode: Client.NoSOAPAction

                          faultSubcode:

                          faultString: no SOAPAction header!

                          faultActor:

                          faultNode:

                          faultDetail:

                               stackTrace:no SOAPAction header!

                          -


                          I have following routing configuration. Roter start with timer to a bean (myTransform) to external web service. The bean just logs the reques to log. Is there anything that I am missing in the below configuration?

                           

                           

                          • 10. Re: Unable to resolve package javax.xml.rpc
                            ffang

                            Hi,

                             

                            The error

                            faultString: no SOAPAction header!

                            already told that your request miss a SOAPAction header, SOAPAction is a http header and not in the soap payload, you need add correct SOAPAction header to the message before you send out the request, take a look at to get more details how to do it with camel-http producer.

                             

                            http://camel.apache.org/http.html

                            Freeman

                            • 11. Re: Unable to resolve package javax.xml.rpc
                              mpalvankar

                              Thanks Freeman.

                              I will open another thread as the subject of this thread is no longer valid for the issue that I am facing.