1 Reply Latest reply on Oct 4, 2006 6:02 PM by klease

    Exception in wstools wsdl-java, unwrap=true

    klease

      I'm trying to generate a client for a .net webservice. The wsdl uses the wrapped style with anonymous elmeents for the methods and responses, like this:

      <s:element name="TwoParamFunction">
       <s:complexType>
       <s:sequence>
       <s:element minOccurs="0" maxOccurs="1" name="arg1" type="s:string" />
       <s:element minOccurs="0" maxOccurs="1" name="arg2" type="s:string" />
       </s:sequence>
       </s:complexType>
       </s:element>


      I run the wstools from the 1.0.3 release, with following parameters.
       <wsdl-java unwrap="true" file="UnwrapBug.wsdl">
       <mapping file="jaxrpc-mapping.xml" />
       </wsdl-java>
      

      Environment is linux, jboss 4.0.4.GA, jbossws-1.0.3, jdk 1.5.0_07

      I get the following error:
      Exception in thread "main" org.jboss.ws.WSException: String passed is null
      at org.jboss.ws.metadata.wsdl.WSDLUtils.firstLetterUpperCase(WSDLUtils.java:453)
      at org.jboss.ws.tools.XSDTypeToJava.createJavaFile(XSDTypeToJava.java:138)
      at org.jboss.ws.tools.XSDTypeToJava.createJavaFile(XSDTypeToJava.java:114)
      at org.jboss.ws.tools.WSDLToJava.generateJavaSource(WSDLToJava.java:701) at org.jboss.ws.tools.WSDLToJava.generateJavaSource(WSDLToJava.java:694) at org.jboss.ws.tools.WSDLToJava.unwrapResponse(WSDLToJava.java:321)
      at org.jboss.ws.tools.WSDLToJava.getReturnType(WSDLToJava.java:555)
      at org.jboss.ws.tools.WSDLToJava.appendMethods(WSDLToJava.java:372)
      at org.jboss.ws.tools.WSDLToJava.createSEIFile(WSDLToJava.java:512)
      at org.jboss.ws.tools.WSDLToJava.createSEI(WSDLToJava.java:534)
      at org.jboss.ws.tools.WSDLToJava.generateSEI(WSDLToJava.java:188)
      at org.jboss.ws.tools.helpers.ToolsHelper.handleWSDLToJavaGeneration(ToolsHelper.java:329)
      at org.jboss.ws.tools.WSTools.process(WSTools.java:138)
      at org.jboss.ws.tools.WSTools.generate(WSTools.java:120)
      at org.jboss.ws.tools.WSTools.main(WSTools.java:61)
      ------------------
      I assume this is a bug?
      The workaround is to modify the wsdl so that the elements reference separate defined type elements, like this:
      <s:element name="TwoParamFunction" type="tns:TwoParamFunctionType"/>
       <s:complexType name="TwoParamFunctionType">
       <s:sequence>
       <s:element minOccurs="0" maxOccurs="1" name="arg1" type="s:string" />
       <s:element minOccurs="0" maxOccurs="1" name="arg2" type="s:string" />
       </s:sequence>
       </s:complexType>
      

      Then correct java is generated.