[jboss-user] [JBossWS] - Re: JSR -181 Start with WSDL and Java

stevenh do-not-reply at jboss.com
Thu Aug 24 01:47:04 EDT 2006


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>
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967145#3967145

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967145



More information about the jboss-user mailing list