6 Replies Latest reply on Mar 5, 2006 10:00 AM by thomas.diesler

    differences between wscompile and jbossws type name mapping

    andrewtv

      I'm new to the JBossWS layer, and have run into the following issue with anonymous type name mapping (perhaps it is a result of the new JSR). As an example, try the following wsdl file from Google's APIs (just enough info to show the issue):

      https://adwords.google.com/api/adwords/v3/InfoService?wsdl

      Inside here is the following anonymous type:

       <element name="getOperationsQuotaThisMonth">
       <complexType/>
       </element>
      


      Now, wscompile generates the following type mapping for it:

       <java-xml-type-mapping>
       <java-type>google.GetOperationsQuotaThisMonth</java-type>
       <root-type-qname xmlns:typeNS="https://adwords.google.com/api/adwords/v3">typeNS:getOperationsQuotaThisMonth</root-type-qname>
       <qname-scope>complexType</qname-scope>
       </java-xml-type-mapping>
      


      Note wscompile from jwsdp 2.0 does not generate this as an "anonymous-type-qname" (I am not sure why). However, JBossWS treats this as an anonymous-type-qname when reading the wsdl file and then fails to look up:

      org.jboss.ws.WSException: Cannot obtain java type mapping for:
      {https://adwords.google.com/api/adwords/v3}>getOperationsQuotaThisMonth
      


      because it is stored I think in the org.jboss.ws.metadata.TypesMetaData without the ">" as:

      {https://adwords.google.com/api/adwords/v3}getOperationsQuotaThisMonth
      


      Anyone have any ideas on why these are different? Would it be better to just switch to wstools?

      Andrew


        • 1. Re: differences between wscompile and jbossws type name mapp
          andrewtv

          I am going to try wstools (as it probably understands itself better :-).

          • 2. Re: differences between wscompile and jbossws type name mapp
            andrewtv

            Hmm.. jboss head (from today) gives the following NPE in wsdl2Java... anyone have any thoughts? Something with xerces it seems...

             [wstools] 19:15:32,105 DEBUG [main:WSDL11Reader] processSchemaInclude: [targetNS=https://adwords.google.com/api/adwords/v3,parentURL=file:<path>/wsdl/google/InfoService.wsdl]
             [wstools] java.lang.NullPointerException
             [wstools] at java.lang.System.arraycopy(Native Method)
             [wstools] at org.apache.xerces.impl.xs.XSModelImpl.getAnnotations(Unknown Source)
             [wstools] at org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils.copyXSModel(WSSchemaUtils.java:711)
             [wstools] at org.jboss.ws.tools.JavaToXSD.parseSchema(JavaToXSD.java:206)
             [wstools] at org.jboss.ws.metadata.wsdl.WSDL11Reader.processTypes(WSDL11Reader.java:212)
             [wstools] at org.jboss.ws.metadata.wsdl.WSDL11Reader.process(WSDL11Reader.java:123)
             [wstools] at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:140)
             [wstools] at org.jboss.ws.tools.WSDLToJava.convertWSDL2Java(WSDLToJava.java:110)
             [wstools] at org.jboss.ws.tools.helpers.ToolsHelper.handleWSDLToJavaGeneration(ToolsHelper.java:190)
             [wstools] at org.jboss.ws.tools.WSTools.process(WSTools.java:122)
             [wstools] at org.jboss.ws.tools.WSTools.generate(WSTools.java:109)
             [wstools] at org.jboss.ws.tools.ant.wstools.execute(wstools.java:103)
             [wstools] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
            



            • 3. Re: differences between wscompile and jbossws type name mapp
              andrewtv

              Ok... updating xerces seemed to fix that!

              • 4. Re: differences between wscompile and jbossws type name mapp
                andrewtv

                Well, almost... xerces updated but a nice WSException:

                 [wstools] 19:54:53,612 DEBUG [main:WSDLBinding] new WSDLBinding
                 [wstools] 19:54:53,612 DEBUG [main:WSDLBinding] setName: InfoServiceSoapBinding
                 [wstools] 19:54:53,613 DEBUG [main:WSDLBinding] setInterfaceName: InfoServiceSoapBinding
                 [wstools] org.jboss.ws.WSException: File Name is null
                 [wstools] at org.jboss.ws.tools.XSDTypeToJava.createJavaFile(XSDTypeToJava.java:88)
                 [wstools] at org.jboss.ws.tools.WSDLToJava.generateJavaSource(WSDLToJava.java:492)
                 [wstools] at org.jboss.ws.tools.WSDLToJava.getReturnType(WSDLToJava.java:378)
                 [wstools] at org.jboss.ws.tools.WSDLToJava.appendMethods(WSDLToJava.java:220)
                 [wstools] at org.jboss.ws.tools.WSDLToJava.createSEIFile(WSDLToJava.java:321)
                 [wstools] at org.jboss.ws.tools.WSDLToJava.createSEI(WSDLToJava.java:343)
                




                • 5. Re: differences between wscompile and jbossws type name mapp
                  andrewtv

                  Ok, investigating a bit further, I don't think WSDLToJava handles anonymous complex types properly yet (it assumes the type is named). I believe someone logged the issue is in JIRA:

                  http://jira.jboss.com/jira/browse/JBWS-624

                  • 6. Re: differences between wscompile and jbossws type name mapp
                    thomas.diesler

                    Yes, this is a known issue which also shows up as part of JBWS-718. Utill wstools can handle this you probably need to manually fix the generated jaxrpc-mapping.xml