EJB3 + WebServices + Type Schema Generation
pablojavierpy Jun 2, 2006 8:19 PMHi all.
I am having a little problem with EJB3 + WebServices exposed as SEI JSR-181.
I am using the JSR-181 annotations, JBoss 4.0.4 GA with JBossWS 1.0.
I have no problems when using simple types.
But when it comes to complex types with arrays, I think I am getting wrong WSDL generated.
This is my WebService:
@WebService ( name = "SessionManagement", targetNamespace = "http://com.roshka.services/myapplication/", serviceName = "SessionManagementService" ) @SOAPBinding(style = SOAPBinding.Style.RPC) @Stateless public class SessionManagementEJB {
The methods I am exposing are:
@WebMethod public String getCurrentVersion() { return SessionManagementEJB.CURRENT_VERSION; } @WebMethod public RUCASConnectResponse RUCASConnect( AppInfo appInfo, LoginMethod[] loginMethods, CryptMethod[] cryptMethods ) { return null; }
The problem is that the WSDL I am getting generated contains two definitions of CryptMethod type in two different namespaces. Is it correct?
<definitions name='SessionManagementService' targetNamespace='http://com.roshka.services/myapplication/' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://security.beans.rucas.set.gov.py/jaws' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://com.roshka.services/myapplication/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'> <types> <schema elementFormDefault='qualified' targetNamespace='http://com.roshka.services/myapplication/' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns2='http://www.w3.org/2001/XMLSchema' xmlns:ns3='http://security.beans.rucas.set.gov.py/jaws' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://com.roshka.services/myapplication/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <import namespace='http://security.beans.rucas.set.gov.py/jaws'/> <import namespace='http://www.w3.org/2001/XMLSchema'/> <complexType name='AppInfo'> <sequence> <element name='language' nillable='true' type='string'/> <element name='name' nillable='true' type='string'/> <element name='uuid' nillable='true' type='string'/> <element name='version' nillable='true' type='string'/> </sequence> </complexType> <complexType name='ClientSystem'> <sequence> <element name='id' nillable='true' type='int'/> <element name='name' nillable='true' type='string'/> <element name='password' nillable='true' type='base64Binary'/> </sequence> </complexType> <complexType name='CryptMethod'> <sequence> <element name='code' nillable='true' type='string'/> <element name='name' nillable='true' type='string'/> <element name='version' nillable='true' type='string'/> </sequence> </complexType> <complexType name='CryptMethod.Array'> <sequence> <element maxOccurs='unbounded' minOccurs='0' name='value' nillable='true' type='ns3:CryptMethod'/> </sequence> </complexType> <complexType name='LoginMethod'> <sequence> <element name='code' nillable='true' type='string'/> <element name='name' nillable='true' type='string'/> <element name='version' nillable='true' type='string'/> </sequence> </complexType> <complexType name='LoginMethod.Array'> <sequence> <element maxOccurs='unbounded' minOccurs='0' name='value' nillable='true' type='ns3:LoginMethod'/> </sequence> </complexType> <complexType name='RUCASConnectResponse'> <sequence> <element name='cryptMethod' nillable='true' type='ns3:CryptMethod'/> <element name='loginMethod' nillable='true' type='ns3:LoginMethod'/> <element name='temporarySessionId' nillable='true' type='string'/> </sequence> </complexType> <complexType name='RUCASLoginResponse'> <sequence> <element name='permanentSessionId' nillable='true' type='string'/> <element name='success' nillable='true' type='boolean'/> </sequence> </complexType> </schema> <schema elementFormDefault='qualified' targetNamespace='http://security.beans.rucas.set.gov.py/jaws' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns1='http://com.roshka.services/myapplication/' xmlns:ns2='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://security.beans.rucas.set.gov.py/jaws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <import namespace='http://com.roshka.services/myapplication/'/> <import namespace='http://www.w3.org/2001/XMLSchema'/> <complexType name='CryptMethod'> <sequence> <element name='code' nillable='true' type='string'/> <element name='name' nillable='true' type='string'/> <element name='version' nillable='true' type='string'/> </sequence> </complexType> <complexType name='LoginMethod'> <sequence> <element name='code' nillable='true' type='string'/> <element name='name' nillable='true' type='string'/> <element name='version' nillable='true' type='string'/> </sequence> </complexType> </schema> </types> <message name='SessionManagement_getCurrentVersion'></message> <message name='SessionManagement_getClientSystem'></message> <message name='SessionManagement_RUCASLogin'> <part name='LoginMethod_1' type='tns:LoginMethod'/> <part name='CryptMethod_1' type='tns:CryptMethod'/> </message> <message name='SessionManagement_getClientSystemResponse'> <part name='result' type='tns:ClientSystem'/> </message> <message name='SessionManagement_RUCASLoginResponse'> <part name='result' type='tns:RUCASLoginResponse'/> </message> <message name='SessionManagement_getCurrentVersionResponse'> <part name='result' type='xsd:string'/> </message> <message name='SessionManagement_RUCASConnectResponse'> <part name='result' type='tns:RUCASConnectResponse'/> </message> <message name='SessionManagement_RUCASConnect'> <part name='AppInfo_1' type='tns:AppInfo'/> <part name='LoginMethod_1' type='tns:LoginMethod.Array'/> <part name='CryptMethod_1' type='tns:CryptMethod.Array'/> </message> <portType name='SessionManagement'> <operation name='RUCASConnect' parameterOrder='AppInfo_1 LoginMethod_1 CryptMethod_1'> <input message='tns:SessionManagement_RUCASConnect'/> <output message='tns:SessionManagement_RUCASConnectResponse'/> </operation> <operation name='RUCASLogin' parameterOrder='LoginMethod_1 CryptMethod_1'> <input message='tns:SessionManagement_RUCASLogin'/> <output message='tns:SessionManagement_RUCASLoginResponse'/> </operation> <operation name='getClientSystem'> <input message='tns:SessionManagement_getClientSystem'/> <output message='tns:SessionManagement_getClientSystemResponse'/> </operation> <operation name='getCurrentVersion'> <input message='tns:SessionManagement_getCurrentVersion'/> <output message='tns:SessionManagement_getCurrentVersionResponse'/> </operation> </portType> <binding name='SessionManagementBinding' type='tns:SessionManagement'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> <operation name='RUCASConnect'> <soap:operation soapAction=''/> <input> <soap:body namespace='http://py.gov.set.services/rucas/' use='literal'/> </input> <output> <soap:body namespace='http://py.gov.set.services/rucas/' use='literal'/> </output> </operation> <operation name='RUCASLogin'> <soap:operation soapAction=''/> <input> <soap:body namespace='http://py.gov.set.services/rucas/' use='literal'/> </input> <output> <soap:body namespace='http://py.gov.set.services/rucas/' use='literal'/> </output> </operation> <operation name='getClientSystem'> <soap:operation soapAction=''/> <input> <soap:body namespace='http://py.gov.set.services/rucas/' use='literal'/> </input> <output> <soap:body namespace='http://py.gov.set.services/rucas/' use='literal'/> </output> </operation> <operation name='getCurrentVersion'> <soap:operation soapAction=''/> <input> <soap:body namespace='http://py.gov.set.services/rucas/' use='literal'/> </input> <output> <soap:body namespace='http://py.gov.set.services/rucas/' use='literal'/> </output> </operation> </binding> <service name='SessionManagementService'> <port binding='tns:SessionManagementBinding' name='SessionManagementPort'> <soap:address location='http://ERRE:8080/rucas/SessionManagementEJB'/> </port> </service> </definitions>