8 Replies Latest reply on Oct 26, 2006 7:48 PM by Jason Greene

    Are Axis client calls to JBossWS @WebService services suppos

    J. L. Schilling Newbie

      I'm exposing a simple web service using JBoss 4.0.4.GA, JBossWS 1.0.2.GA,
      and the @WebService JSR-181 style approach. I'm trying to call it from an
      Apache Axis 1.2 client. No matter what combination of SOAP body encodings I try on the service and on the client, I get errors from JBossWS complaining about the structure or contents of the incoming SOAP message.

      I can post further details, but first I'd just like to ask, has JBossWS-Axis interoperability work and testing been done? Or is Axis considered too
      non-standard? Or this just hasn't been gotten to yet? I haven't seen much discussion of this interop situation in the forum (most Axis references are to the obsolete, old Axis-based JBossWS, which I'm not using).

      So have others gone down this path, or am I exploring new territory?

      thanks,
      J. L.

        • 1. Re: Are Axis client calls to JBossWS @WebService services su
          Heiko Braun Master

          Well, the Axis implementation might not follow standards, still the messages on the wire need to. Could you provide some more detailed error description, i.e. stacktrace, log output?

          • 2. Re: Are Axis client calls to JBossWS @WebService services su
            J. L. Schilling Newbie

             

            "heiko.braun@jboss.com" wrote:
            Well, the Axis implementation might not follow standards, still the messages on the wire need to. Could you provide some more detailed error description, i.e. stacktrace, log output?


            OK, here's the details.

            The web service in JBoss 4.0.4.GA/JBossWS 1.0.2.GA looks like this.
            It's basically a simple method that takes two strings as parameters.

            // JSR-181 annotations
            @WebService(name="AarEndpointInterface",
            targetNamespace="http://service.bar.foo.com/Aar",
            serviceName="AarService")
            @SOAPBinding(style=SOAPBinding.Style.RPC, use=SOAPBinding.Use.LITERAL)

            // EJB3 annotations
            @Remote(AarEJB3RemoteInterface.class)
            @Stateless

            // JBoss annotations
            @RemoteBinding(jndiBinding = "/webservice/bar/Aar")

            public class Aar implements AarEJB3RemoteInterface {

            @WebMethod
            public boolean func(
            String firstInfo,
            String messageText)
            { ...

            The Axis 1.2-based client makes a call, which sends in this SOAP envelope,
            as shown in the JBoss server.log:

            2006-08-18 09:21:14,000 DEBUG [jbossws.SOAPMessage] Incomming SOAPMessage
            <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
            <soapenv:Header/>
            <soapenv:Body>
            <ns1:func soapenv:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:ns1='http://service.bar.foo.com/Aar'>
            <ns1:arg0 xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xsi:type='soapenc:string'>fff</ns1:arg0>
            <ns1:arg1 xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xsi:type='soapenc:string'>g6</ns1:arg1>
            </ns1:func>
            </soapenv:Body>
            </soapenv:Envelope>
            2006-08-18 09:21:14,000 DEBUG [org.jboss.ws.soap.SOAPMessageDispatcher] getDispatchDestination: {http://service.bar.foo.com/Aar}func
            2006-08-18 09:21:14,000 DEBUG [org.jboss.ws.binding.soap.SOAPBindingProvider] unbindRequestMessage: {http://service.bar.foo.com/Aar}func
            2006-08-18 09:21:14,000 DEBUG [javax.xml.rpc.soap.SOAPFaultException] new SOAPFaultException [code={http://schemas.xmlsoap.org/soap/envelope/}Client,string=Cannot find child element: String_1,actor=null,detail=null]^M
            2006-08-18 09:21:14,000 ERROR [org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper] SOAP request exception
            javax.xml.rpc.JAXRPCException: Cannot find child element: String_1
            at org.jboss.ws.binding.soap.SOAPBindingProvider.getParameterFromMessage(SOAPBindingProvider.java:777)
            at org.jboss.ws.binding.soap.SOAPBindingProvider.unbindRequestMessage(SOAPBindingProvider.java:236)
            at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:112)
            at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:219)
            at org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:355)
            at org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:115)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            ...

            The "Cannot find child element: String_1" exception is thus propogated
            back to the Axis client.

            thanks again,

            J.L.

            • 3. Re: Are Axis client calls to JBossWS @WebService services su
              J. L. Schilling Newbie

              Update ... I had been using the DII interface, and still haven't gotten that
              to work.

              However, when I use the wsdl2java tool and static proxy code generation,
              my call goes through ok. So I think I'm alright.

              J.L.

              • 4. Re: Are Axis client calls to JBossWS @WebService services su
                Thomas Diesler Master

                You need to check whether the SOAP message sent by Axis conforms to the abstract contract defined in the wsdl that is generated by your jsr181 endpoint. i.e. is the message valid?

                • 5. Re: Are Axis client calls to JBossWS @WebService services su
                  Eric Ray Novice

                  I have the same problem. Any resolution? I've googled the heck out of this and no luck finding a resolution. I'm stumped.

                  WebService...

                  @WebService(targetNamespace="http://distributedcapture.vicor.com/ws/rids")
                  @SOAPBinding(style=SOAPBinding.Style.RPC)
                  public class ListDates {
                  
                   @WebMethod
                   public String[] listDates(String env, String account) {
                   ListPackageInfo info = null;
                   try {
                   InitialContext ctx = new InitialContext();
                   info = (ListPackageInfo) ctx.lookup("DistributedCapture/ListPackageInfoBean/local");
                   }
                   catch (Exception e) {
                   e.printStackTrace(System.err);
                   }
                   return info.listDates(env, account);
                   }
                  
                  }
                  


                  Incoming soap taken from server.log
                  <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
                  xmlns:xsd='http://www.w3.org/2001/XMLSchema'
                  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
                  
                  <soap:Header/>
                  <soap:Body>
                  <listDates xmlns='http://distributedcapture.vicor.com/ws/rids'>
                  <String_1 xmlns='http://distributedcapture.vicor.com/ws/rids' xsi:type='xsd:string'>env1</String_1>
                  <String_2 xmlns='http://distributedcapture.vicor.com/ws/rids' xsi:type='xsd:string'>1</String_2>
                  </listDates></soap:Body></soap:Envelope>
                  


                  wsdl
                  - <definitions name="ListDatesService"
                  targetNamespace="http://distributedcapture.vicor.com/ws/rids"
                  xmlns="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                  xmlns:tns="http://distributedcapture.vicor.com/ws/rids"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                   <types />
                  - <message name="ListDates_listDatesResponse">
                   <part name="result" type="xsd:NMTOKENS" />
                   </message>
                  - <message name="ListDates_listDates">
                   <part name="String_1" type="xsd:string" />
                   <part name="String_2" type="xsd:string" />
                   </message>
                  - <portType name="ListDates">
                  - <operation name="listDates" parameterOrder="String_1 String_2">
                   <input message="tns:ListDates_listDates" />
                   <output message="tns:ListDates_listDatesResponse" />
                   </operation>
                   </portType>
                  - <binding name="ListDatesBinding" type="tns:ListDates">
                   <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
                  - <operation name="listDates">
                   <soap:operation soapAction="" />
                  - <input>
                   <soap:body namespace="http://distributedcapture.vicor.com/ws/rids" use="literal" />
                   </input>
                  - <output>
                   <soap:body namespace="http://distributedcapture.vicor.com/ws/rids" use="literal" />
                   </output>
                   </operation>
                   </binding>
                  - <service name="ListDatesService">
                  - <port binding="tns:ListDatesBinding" name="ListDatesPort">
                   <soap:address location="http://redbull:8080/dcap/ListDates" />
                   </port>
                   </service>
                   </definitions>
                  


                  • 6. Re: Are Axis client calls to JBossWS @WebService services su
                    delkant Newbie

                    i've the same problem, any ideas?
                    maybe jbossws-1.0.3??

                    thanks

                    • 7. Re: Are Axis client calls to JBossWS @WebService services su
                      Jason Greene Master

                       

                      "jlselsewh" wrote:

                      <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
                      <soapenv:Header/>
                      <soapenv:Body>
                      <ns1:func soapenv:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:ns1='http://service.bar.foo.com/Aar'>
                      <ns1:arg0 xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xsi:type='soapenc:string'>fff</ns1:arg0>
                      <ns1:arg1 xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xsi:type='soapenc:string'>g6</ns1:arg1>
                      </ns1:func>
                      </soapenv:Body>
                      </soapenv:Envelope>



                      This particular message is a rpc/encoded message, and the WSDL is defined as an rpc/literal message, so it is incorrect.

                      -Jason

                      • 8. Re: Are Axis client calls to JBossWS @WebService services su
                        Jason Greene Master

                         

                        "c_eric_ray" wrote:

                        Incoming soap taken from server.log
                        
                        <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
                        xmlns:xsd='http://www.w3.org/2001/XMLSchema'
                        xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
                        
                        <soap:Header/>
                        <soap:Body>
                        <listDates xmlns='http://distributedcapture.vicor.com/ws/rids'>
                        <String_1 xmlns='http://distributedcapture.vicor.com/ws/rids' xsi:type='xsd:string'>env1</String_1>
                        <String_2 xmlns='http://distributedcapture.vicor.com/ws/rids' xsi:type='xsd:string'>1</String_2>
                        </listDates></soap:Body></soap:Envelope>
                        



                        This one however is a problem with gratuitous xsi:types we recently fixed, it will be included in 1.0.4:

                        http://jira.jboss.com/jira/browse/JBWS-1303

                        -Jason