6 Replies Latest reply on Sep 11, 2006 6:44 PM by Steve

    JSR -181 Start with WSDL and Java

    Steve Newbie

      I was just curious about the state of the "Start with WSDL and Java" (2.2.3) for mapping the WSDL Directory to the Java class.

      I have been having a few issues with the Start with Java and it generating inconsistent WSDL's, (which ill post when i manage to pin down). And thought that i do prefer to start with a wsdl and map these across to the java class.

        • 1. Re: JSR -181 Start with WSDL and Java
          Steve Newbie

          I have been messing round with the wsdlLocation attribute on the WebService annotation and this looks like it will give me the consistency that i was after.

          Steve.

          • 2. Re: JSR -181 Start with WSDL and Java
            Steve Newbie

            Alright i have been having a bit of a play with my classes as one of my web services was behaving in what can only be described as an interesting maner.

            I am looking at the generated wsdl from my soap class and it works fine as per the listing below. but if i change the method name of getResult to getResult1 it seperates out the elements into two difference schemas. See below.

            I would not have expected the change to the method name to have any effect on the actual wsdl ( given the name paramaters are specified). it does seem a little fragile.

            @WebService(targetNamespace = "http://cs_dev.test/aua/User")
            @SOAPBinding(
             style = SOAPBinding.Style.RPC,
             use = SOAPBinding.Use.LITERAL,
             parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
            
            public class AuUserWs {
            
             private static final Logger log = Logger.getLogger(AuUserWs.class);
            
             @WebMethod(operationName = "GetAuUserRole")
             @WebResult(name = "Userrole")
             public AuUserRole getResult(
             @WebParam(name = "AuNumber") int pAuNumber,
             @WebParam(name = "RoleCode") String pRoleCode,
             @WebParam(name = "Location") String pLocation
             ) throws DataBaseException, AuaSystemException {
             return null;
             }
            
             @WebMethod(operationName = "GetAuUserRoles")
             @WebResult(name = "Userroles")
             public AuUserRole[] getResults(
             @WebParam(name = "AuNumber")int _pAuNumber
             ) throws DataBaseException, AuaSystemException {
             return null;
             }
            }


            Produces


            <type>
             <schema elementFormDefault='qualified' targetNamespace='http://cs_dev.test/aua/User' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://cs_dev.test/aua/User' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
             <complexType name='AuUserRole'>
             <sequence>
             <element name='auNumber' type='int'/>
             <element name='dateEntered' nillable='true' type='string'/>
             <element name='dateLastModified' nillable='true' type='string'/>
             <element name='delegation' nillable='true' type='string'/>
             <element name='deleted' nillable='true' type='string'/>
             <element name='disabled' nillable='true' type='string'/>
             <element name='expiryDate' nillable='true' type='string'/>
             <element name='facility' nillable='true' type='string'/>
             <element name='lastModifiedBy' nillable='true' type='string'/>
             <element name='locationCode' nillable='true' type='string'/>
             <element name='notes' nillable='true' type='string'/>
             <element name='priorityOrder' type='int'/>
             <element name='roleCode' nillable='true' type='string'/>
             <element name='roleType' nillable='true' type='string'/>
             <element name='soleSignatory' nillable='true' type='string'/>
             <element name='startDate' nillable='true' type='string'/>
             </sequence>
             </complexType>
             <complexType name='AuUserRole.Array'>
             <sequence>
             <element maxOccurs='unbounded' minOccurs='0' name='value' nillable='true' type='tns:AuUserRole'/>
             </sequence>
             </complexType>
             <complexType name='AuaSystemException'>
             <sequence/>
             </complexType>
             <complexType name='DataBaseException'>
             <sequence/>
             </complexType>
             <element name='AuaSystemException' type='tns:AuaSystemException'/>
             <element name='DataBaseException' type='tns:DataBaseException'/>
             </schema>
            </type>


            but

            @WebService(targetNamespace = "http://cs_dev.test/aua/User")
            @SOAPBinding(
             style = SOAPBinding.Style.RPC,
             use = SOAPBinding.Use.LITERAL,
             parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
            
            public class AuUserWs {
            
             private static final Logger log = Logger.getLogger(AuUserWs.class);
            
             @WebMethod(operationName = "GetAuUserRole")
             @WebResult(name = "Userrole")
             public AuUserRole getResult1(
             @WebParam(name = "AuNumber") int pAuNumber,
             @WebParam(name = "RoleCode") String pRoleCode,
             @WebParam(name = "Location") String pLocation
             ) throws DataBaseException, AuaSystemException {
             return null;
             }
            
             /**
             *
             * @param _pAuNumber int
             * @return AuUserRole[]
             * @throws DataBaseException
             */
             @WebMethod(operationName = "GetAuUserRoles")
             @WebResult(name = "Userroles")
             public AuUserRole[] getResults(
             @WebParam(name = "AuNumber")int _pAuNumber
             ) throws DataBaseException, AuaSystemException {
             return null;
             }
            }
            


            produces
             <types>
             <schema elementFormDefault='qualified' targetNamespace='http://dto.aua.server.chw/jaws' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns1='http://cs_dev.test/aua/User' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://dto.aua.server.chw/jaws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
             <import namespace='http://cs_dev.test/aua/User'/>
             <complexType name='AuUserRole'>
             <sequence>
             <element name='auNumber' type='int'/>
             <element name='dateEntered' nillable='true' type='string'/>
             <element name='dateLastModified' nillable='true' type='string'/>
             <element name='delegation' nillable='true' type='string'/>
             <element name='deleted' nillable='true' type='string'/>
             <element name='disabled' nillable='true' type='string'/>
             <element name='expiryDate' nillable='true' type='string'/>
             <element name='facility' nillable='true' type='string'/>
             <element name='lastModifiedBy' nillable='true' type='string'/>
             <element name='locationCode' nillable='true' type='string'/>
             <element name='notes' nillable='true' type='string'/>
             <element name='priorityOrder' type='int'/>
             <element name='roleCode' nillable='true' type='string'/>
             <element name='roleType' nillable='true' type='string'/>
             <element name='soleSignatory' nillable='true' type='string'/>
             <element name='startDate' nillable='true' type='string'/>
             </sequence>
             </complexType>
             </schema>
             <schema elementFormDefault='qualified' targetNamespace='http://cs_dev.test/aua/User' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns2='http://dto.aua.server.chw/jaws' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://cs_dev.test/aua/User' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
             <import namespace='http://dto.aua.server.chw/jaws'/>
             <complexType name='AuUserRole'>
             <sequence>
             <element name='auNumber' type='int'/>
             <element name='dateEntered' nillable='true' type='string'/>
             <element name='dateLastModified' nillable='true' type='string'/>
             <element name='delegation' nillable='true' type='string'/>
             <element name='deleted' nillable='true' type='string'/>
             <element name='disabled' nillable='true' type='string'/>
             <element name='expiryDate' nillable='true' type='string'/>
             <element name='facility' nillable='true' type='string'/>
             <element name='lastModifiedBy' nillable='true' type='string'/>
             <element name='locationCode' nillable='true' type='string'/>
             <element name='notes' nillable='true' type='string'/>
             <element name='priorityOrder' type='int'/>
             <element name='roleCode' nillable='true' type='string'/>
             <element name='roleType' nillable='true' type='string'/>
             <element name='soleSignatory' nillable='true' type='string'/>
             <element name='startDate' nillable='true' type='string'/>
             </sequence>
             </complexType>
             <complexType name='AuUserRole.Array'>
             <sequence>
             <element maxOccurs='unbounded' minOccurs='0' name='value' nillable='true' type='ns2:AuUserRole'/>
             </sequence>
             </complexType>
             <complexType name='AuaSystemException'>
             <sequence/>
             </complexType>
             <complexType name='DataBaseException'>
             <sequence/>
             </complexType>
             <element name='AuaSystemException' type='tns:AuaSystemException'/>
             <element name='DataBaseException' type='tns:DataBaseException'/>
             </schema>
             </types>
            


            • 3. Re: JSR -181 Start with WSDL and Java
              Steve Newbie

              Sorry i forgot to mention i am running 4.0.4GA with jbossws 1.0.2GA.

              Steve

              • 4. Re: JSR -181 Start with WSDL and Java
                Thomas Diesler Master

                Steve, from all your good posts I very well think you qualify as a contributer. We are trying to get a fully certified JAXWS implementation out of the door by the end of the year - this is exciting stuff.

                If you are interested please write to me directly and I can give you further directions.

                • 5. Re: JSR -181 Start with WSDL and Java
                  Thomas Diesler Master

                  WSDL generation for JSR-181 only work s for trivial use cases. This is because JSR181 should really not work at all for JAXRPC. It is targeted for JAXWS where all marshalling unmarshhalling is delegated to JAXB

                  Please monitor

                  http://jira.jboss.org/jira/browse/JBWS-1101

                  • 6. Re: JSR -181 Start with WSDL and Java
                    Steve Newbie

                    Hi Thomas,
                    I can accept that wsdl generation only works for trivial use cases. The actual problem is how unpredictable the existing code generation is.

                    My 3rd post in this thread show how changing a method name by one character can cause different wsdls. I would not have expected any changes to the method names to have any effect on the wsdl given the operationNames attributes are specified.

                    Steve.