Using JSR181 - problem with value types and arrays
matabu May 18, 2006 6:32 PMHi all.
I am trying to create a webservice. Spezifying the Webmethods with JSR-181.
With primitive data types the service runs fine. But as I try to use a data object (value type) of a simple structure (only having types like int, boolean, String... default contructor etc... like the api says) or using a WebMethod which returns an int[] I get following exception:
15:59:05,521 INFO [WSDLFilePublisher] WSDL published to: file:/C:/JavaDev/jboss-4.0.4CR2/server/default/data/wsdl/ebe.ear/ebe.war/mase.wsdl 15:59:05,521 ERROR [MainDeployer] Could not start deployment: file:/C:/JavaDev/jboss-4.0.4CR2/server/default/tmp/deploy/tmp51295ebe.ear-contents/ebe.war org.jboss.ws.WSException: Cannot load java type: webservice.ArrayOf_xsd_int at org.jboss.ws.metadata.ParameterMetaData.getJavaType(ParameterMetaData.java:141) at org.jboss.ws.metadata.ParameterMetaData.eagerInitialize(ParameterMetaData.java:291) at org.jboss.ws.metadata.OperationMetaData.eagerInitialize(OperationMetaData.java:474) at org.jboss.ws.metadata.EndpointMetaData.eagerInitialize(EndpointMetaData.java:353) at org.jboss.ws.metadata.ServiceMetaData.eagerInitialize(ServiceMetaData.java:319) at org.jboss.ws.metadata.UnifiedMetaData.eagerInitialize(UnifiedMetaData.java:143)
I'm creating the wsdl file with ant wich looks very good... It doesn"t matter if I am only using the int[] method, the method with my object or both at the same time... Anyway the exception above excuses.
Have a look on the created wsdl:types:
<wsdl:types> <schema targetNamespace="http://webservice.mase" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="ArrayOf_xsd_int"> <sequence> <element maxOccurs="unbounded" minOccurs="0" name="item" type="xsd:int"/> </sequence> </complexType> <complexType name="WsProject"> <sequence> <element name="check" type="xsd:boolean"/> <element name="number1" type="xsd:int"/> <element name="number2" type="xsd:float"/> <element name="text" nillable="true" type="xsd:string"/> </sequence> </complexType> </schema> </wsdl:types>
Also for creating the jaxrpc-mapping.xml I am using ant for running the wstool stuff with following config.xml:
<configuration xmlns="http://www.jboss.org/jbossws-tools" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd"> <wsdl-java file="tmp/web/WEB-INF/wsdl/mase.wsdl"> <mapping file="jaxrpc-mapping.xml" /> </wsdl-java> </configuration>
Ok. I have no idea anymore. Maybe someone has an idea or knows which thing I overlooked.
Thank you very much for your help.
Greets, Andreas