6 Replies Latest reply on Jun 11, 2006 11:56 PM by thomas.diesler

    wsdl2java and JSR181

    klaus_erber

      Hello,

      I have some understanding problems.

      Is it possible to use a hand writed WSDL in conjunction with JSR181 annotations?

      I have generate the endpoint interfaces, data classes and the jaxrpc-mapping.xml with wscompile and put the jaxrpc-mapping.xml file in META-INF of my ejb module.

      The generated WSDL is different than my hand writed WSDL (other namespaces and sequences in schemas). Method calls produces exceptions like this:

      javax.xml.rpc.JAXRPCException: org.jboss.ws.binding.BindingException: javax.xml.bind.JAXBException: Failed to parse source: Requested element jwsParam is not allowed in this position in the sequence. The next element should be {http://metadaten.ws.red.spiegel.de}auswahllisteTyp
       at org.jboss.ws.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:307)
       at org.jboss.ws.binding.EndpointInvocation.transformPayloadValue(EndpointInvocation.java:233)
       at org.jboss.ws.binding.EndpointInvocation.getRequestParamValue(EndpointInvocation.java:103)
       at org.jboss.ws.binding.EndpointInvocation.getRequestPayload(EndpointInvocation.java:117)
       at org.jboss.ws.server.ServiceEndpointInvokerEJB3.invokeServiceEndpoint(ServiceEndpointInvokerEJB3.java:106)
       at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:118)
       at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:234)
       at org.jboss.ws.server.ServiceEndpointServlet.doPost(ServiceEndpointServlet.java:120)
      ...
      


      It seems that the jaxrpc-mapping.xml is not used to map the wsdl structures to the java types. So is this the completly wrong approach? Do we have to go the java2wsdl way?

      Many thanks for your help
      Klaus

        • 1. Re: wsdl2java and JSR181
          thomas.diesler

          The jaxrpc-mapping.xml is not used - full stop.
          It is a JSR109 artifact and does not enter the game with JSR181. With JSR181 the required webservice meta data are obtained through annotations.

          • 2. Re: wsdl2java and JSR181
            martindonaghy

            Hi Thomas,

            I have been following the instructions on http://labs.jboss.com/portal/jbossws/user-guide/en/html/endpoints.html on how to deploy an ejb 3.0 as a web service. I have used wstools to generate the client artifacts (jaxrpc-mapping, stub classes, etc). I have got this to work successfully but why is jaxrpc-mapping not needed for JSR-181? Have I missed something? Am I doing this wrong?

            thanks
            Martin

            • 3. Re: wsdl2java and JSR181
              klaus_erber

              ok, thank you Thomas for the help and the very fast reply,

              that means, that we cannot create a service from a existing wsdl and give that wsdl to the customer.

              That is ok, we can define our services direct in java with annotations and give the resulting wsdl to the customer.

              But what about the other wsdl/schema features like constraints (minOccurs...) or default values? Did the come with EE5 compatible webservices and JAXB annontations?

              greetings
              Klaus

              • 4. Re: wsdl2java and JSR181
                thomas.diesler

                JSR181 is about server side meta data. It does not need jaxrpc-mapping.xml.

                A WS client is fundametally disconnected and does not know nor care about the implementation details of the the server side. It relies on the abstract contract defined in wsdl and needs jaxrpc-mapping.xml to map wsdl contructs to the java.

                With JSR109 the server also obtains the meta data from wsdl + jaxrpc-mapping.xml

                • 5. Re: wsdl2java and JSR181
                  klaus_erber

                  Hi,

                  the only contract to the client must be the wsdl without jaxrpc-mapping.xml. Otherwise we run into problems with non-Java clients like .net or Perl.

                  Klaus

                  • 6. Re: wsdl2java and JSR181
                    thomas.diesler

                    wsdl is always language agnostic. With WS4EE you need jaxrpc-mapping.xml.

                    .net or perl need simmilar mapping meta data to map to their language domain