[jboss-user] [JBossWS] - JBoss wstool generate incorrect WSDL file

mendaye do-not-reply at jboss.com
Thu Sep 6 18:32:05 EDT 2007


Hello All:

I am using JBOSS 4.0.4 to do web services development. I have created WSDL and all other XML file for my EJB end-point using JBoss wstool. I have successfully deployed and tested this Web Service. However, it worked fine when the rutun type of the methods are Java primitave types. For some reason it doesn't work for Java Collection type (ArrayList, Hashtable, Hashmap) - I get exception from JBoss Server "XML document structures must start and end within the same entity" - I look deep into WSDL file, it seems the complex data type generated for these collection classes and custom object is wrong.  I have attached the code, WSDL and other XML file. I am not sure if I miss something here. Please help!!! 

JBoss ant task

  | <taskdef name="wstools" classname="org.jboss.ws.tools.ant.wstools">
  |       <classpath refid="base.libraries"/>
  |       <classpath refid="client.classpath"/>
  |       <classpath path="${api.classpath.dir}"/>
  |       <classpath path="${db.classpath.dir}"/> 
  |      <!-- <classpath path="${util.classpath.dir}"/> -->
  |  </taskdef>
  | <wstools dest="${dest.dir}" config="${cnfg.dir}/wstools-config.xml"/>
  | 

wstools-config.xml file

  | 
  | <?xml version="1.0" encoding="UTF-8"?>
  | <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">
  |   <java-wsdl>
  |    <service name="PVNGDeviceService" style="document"
  |     endpoint="com.panduit.pvng.service.api.db.interfaces.DeviceEndpoint"/>
  |    <namespaces
  |       target-namespace="http://db.panduit.com/dbaccess"
  |       type-namespace="http://db.panduit.com/dbaccess/types"/>  
  |    <mapping file="jaxrpc-mapping.xml"/>
  |    <webservices ejb-link="PVNGDevice"/>
  |   </java-wsdl>
  | </configuration>
  | 
  | 

Generated WSDL file - Please look at the bold part for complex data type.



  | <?xml version="1.0" encoding="UTF-8"?>
  | <definitions name='PVNGDeviceService' targetNamespace='http://db.panduit.com/dbaccess' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://db.panduit.com/dbaccess/types' xmlns:ns2='http://util.java/jaws' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://db.panduit.com/dbaccess' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
  |  <types>
  |   <schema targetNamespace='http://db.panduit.com/dbaccess/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns2='http://util.java/jaws' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://db.panduit.com/dbaccess/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
  |    <import namespace='http://util.java/jaws'/>
  |    <complexType name='getAllHashValues'>
  |     <sequence>
  |      <element name='String_1' nillable='true' type='string'/>
  |     </sequence>
  |    </complexType>
  |    <complexType name='getAllHashValuesResponse'>
  |     <sequence>
  |      <element name='result' nillable='true' type='ns2:Hashtable'/>
  |     </sequence>
  |    </complexType>
  |    <complexType name='getAllNames'>
  |     <sequence>
  |      <element name='String_1' nillable='true' type='string'/>
  |     </sequence>
  |    </complexType>
  |    <complexType name='getAllNamesResponse'>
  |     <sequence>
  |      <element name='result' nillable='true' type='ns2:Vector'/>
  |     </sequence>
  |    </complexType>
  |    <complexType name='getAllValues'>
  |     <sequence>
  |      <element name='String_1' nillable='true' type='string'/>
  |     </sequence>
  |    </complexType>
  |    <complexType name='getAllValuesResponse'>
  |     <sequence>
  |      <element name='result' nillable='true' type='ns2:HashMap'/>
  |     </sequence>
  |    </complexType>
  |    <complexType name='PVNGAPIException'>
  |     <sequence>
  |      <element name='errorMessage' nillable='true' type='string'/>
  |      <element name='methodName' nillable='true' type='string'/>
  |     </sequence>
  |    </complexType>
  |    <complexType name='getNames'>
  |     <sequence/>
  |    </complexType>
  |    <complexType name='getNamesResponse'>
  |     <sequence>
  |      <element name='result' nillable='true' type='ns2:ArrayList'/>
  |     </sequence>
  |    </complexType>
  |    <element name='getAllHashValues' type='tns:getAllHashValues'/>
  |    <element name='getAllHashValuesResponse' type='tns:getAllHashValuesResponse'/>
  |    <element name='getAllNames' type='tns:getAllNames'/>
  |    <element name='getAllNamesResponse' type='tns:getAllNamesResponse'/>
  |    <element name='getAllValues' type='tns:getAllValues'/>
  |    <element name='getAllValuesResponse' type='tns:getAllValuesResponse'/>
  |    <element name='PVNGAPIException' type='tns:PVNGAPIException'/>
  |    <element name='getNames' type='tns:getNames'/>
  |    <element name='getNamesResponse' type='tns:getNamesResponse'/>
  |   </schema>
  |   <schema targetNamespace='http://util.java/jaws' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns1='http://db.panduit.com/dbaccess/types' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://util.java/jaws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
  |    <import namespace='http://db.panduit.com/dbaccess/types'/>
  |    <complexType name='ArrayList'>
  |     <sequence>
  |      <element name='empty' type='boolean'/>
  |     </sequence>
  |    </complexType>
  |    <complexType name='HashMap'>
  |     <sequence>
  |      <element name='empty' type='boolean'/>
  |     </sequence>
  |    </complexType>
  |    <complexType name='Hashtable'>
  |     <sequence>
  |      <element name='empty' type='boolean'/>
  |     </sequence>
  |    </complexType>
  |    <complexType name='Vector'>
  |     <sequence>
  |      <element name='empty' type='boolean'/>
  |      <element name='size' type='int'/>
  |     </sequence>
  |    </complexType>
  |   </schema>
  |  </types>
  |  <message name='DeviceEndpoint_getAllHashValues'>
  |   <part element='ns1:getAllHashValues' name='parameters'/>
  |  </message>
  |  <message name='DeviceEndpoint_getAllHashValuesResponse'>
  |   <part element='ns1:getAllHashValuesResponse' name='result'/>
  |  </message>
  |  <message name='PVNGAPIException'>
  |   <part element='ns1:PVNGAPIException' name='PVNGAPIException'/>
  |  </message>
  |  <message name='DeviceEndpoint_getAllNames'>
  |   <part element='ns1:getAllNames' name='parameters'/>
  |  </message>
  |  <message name='DeviceEndpoint_getAllNamesResponse'>
  |   <part element='ns1:getAllNamesResponse' name='result'/>
  |  </message>
  |  <message name='DeviceEndpoint_getAllValues'>
  |   <part element='ns1:getAllValues' name='parameters'/>
  |  </message>
  |  <message name='DeviceEndpoint_getAllValuesResponse'>
  |   <part element='ns1:getAllValuesResponse' name='result'/>
  |  </message>
  |  <message name='DeviceEndpoint_getNames'>
  |   <part element='ns1:getNames' name='parameters'/>
  |  </message>
  |  <message name='DeviceEndpoint_getNamesResponse'>
  |   <part element='ns1:getNamesResponse' name='result'/>
  |  </message>
  |  <portType name='DeviceEndpoint'>
  |   <operation name='getAllHashValues'>
  |    <input message='tns:DeviceEndpoint_getAllHashValues'/>
  |    <output message='tns:DeviceEndpoint_getAllHashValuesResponse'/>
  |    <fault message='tns:PVNGAPIException' name='PVNGAPIException'/>
  |   </operation>
  |   <operation name='getAllNames'>
  |    <input message='tns:DeviceEndpoint_getAllNames'/>
  |    <output message='tns:DeviceEndpoint_getAllNamesResponse'/>
  |    <fault message='tns:PVNGAPIException' name='PVNGAPIException'/>
  |   </operation>
  |   <operation name='getAllValues'>
  |    <input message='tns:DeviceEndpoint_getAllValues'/>
  |    <output message='tns:DeviceEndpoint_getAllValuesResponse'/>
  |    <fault message='tns:PVNGAPIException' name='PVNGAPIException'/>
  |   </operation>
  |   <operation name='getNames'>
  |    <input message='tns:DeviceEndpoint_getNames'/>
  |    <output message='tns:DeviceEndpoint_getNamesResponse'/>
  |    <fault message='tns:PVNGAPIException' name='PVNGAPIException'/>
  |   </operation>
  |  </portType>
  |  <binding name='DeviceEndpointBinding' type='tns:DeviceEndpoint'>
  |   <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
  |   <operation name='getAllHashValues'>
  |    <soap:operation soapAction=''/>
  |    <input>
  |     <soap:body use='literal'/>
  |    </input>
  |    <output>
  |     <soap:body use='literal'/>
  |    </output>
  |    <fault name='PVNGAPIException'>
  |     <soap:fault name='PVNGAPIException' use='literal'/>
  |    </fault>
  |   </operation>
  |   <operation name='getAllNames'>
  |    <soap:operation soapAction=''/>
  |    <input>
  |     <soap:body use='literal'/>
  |    </input>
  |    <output>
  |     <soap:body use='literal'/>
  |    </output>
  |    <fault name='PVNGAPIException'>
  |     <soap:fault name='PVNGAPIException' use='literal'/>
  |    </fault>
  |   </operation>
  |   <operation name='getAllValues'>
  |    <soap:operation soapAction=''/>
  |    <input>
  |     <soap:body use='literal'/>
  |    </input>
  |    <output>
  |     <soap:body use='literal'/>
  |    </output>
  |    <fault name='PVNGAPIException'>
  |     <soap:fault name='PVNGAPIException' use='literal'/>
  |    </fault>
  |   </operation>
  |   <operation name='getNames'>
  |    <soap:operation soapAction=''/>
  |    <input>
  |     <soap:body use='literal'/>
  |    </input>
  |    <output>
  |     <soap:body use='literal'/>
  |    </output>
  |    <fault name='PVNGAPIException'>
  |     <soap:fault name='PVNGAPIException' use='literal'/>
  |    </fault>
  |   </operation>
  |  </binding>
  |  <service name='PVNGDeviceService'>
  |   <port binding='tns:DeviceEndpointBinding' name='DeviceEndpointPort'>
  |    <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
  |   </port>
  |  </service>
  | </definitions>
  | 

EJB endpoint remote interface that return collection Vector, ArratList, Hashtable etc..


  | 
  | public interface DeviceEndpoint extends Remote {
  |      public ArrayList<String> getNames() throws RemoteException, PVNGAPIException;
  |      public Vector<String> getAllNames(String s) throws RemoteException, PVNGAPIException;
  |      public HashMap <String, ArrayList> getAllValues(String s) throws RemoteException, PVNGAPIException;
  |      public Hashtable <String, ArrayList> getAllHashValues(String s) throws RemoteException, PVNGAPIException;
  | 
  | 

Please let me know if there is any workaround to this issue.

Regards,
Surafel

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

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



More information about the jboss-user mailing list