9 Replies Latest reply on Oct 1, 2007 9:50 AM by heiko.braun

    Wsconsume generated Stubs failing with JBoss-4.2.0

      I have a problem with generating Stubs from WSDL using Wsconsume, part of WS tools used in JBoss-4.2

      This is the wsdl which i'm using....



      <?xml version="1.0" encoding="UTF-8"?>
       <wsdl:definitions name="insurance_pub" targetNamespace="http://www.myhome.com.au/insurance.doc.wsdl"
       xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
       xmlns:tns="http://www.myhome.com.au/insurance.doc.wsdl"
       xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
       <wsdl:types>
       <xsd:schema
       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       targetNamespace="http://www.myhome.com.au/insurance.doc.wsdl"
       xmlns:edm="http://www.myhome.com.au/insurance.doc.wsdl"
       xmlns:tns="http://localhost/insurance/pub/getMemberInfo">
      
       <xsd:import
       namespace="http://localhost/insurance/pub/getMemberInfo"/>
      
       <xsd:element name="getMemberInfo" type="tns:GetMemberInfoRequest"/>
       <xsd:element name="getMemberInfoResponse" type="tns:GetMemberInfoResponse"/>
       </xsd:schema>
      
       <xsd:schema
       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       targetNamespace="http://localhost/insurance/pub/getMemberInfo"
       xmlns:tns="http://localhost/insurance/pub/getMemberInfo"
       xmlns:edm="http://www.myhome.com.au/insurance.doc.wsdl">
      
       <xsd:import
       namespace="http://www.myhome.com.au/insurance.doc.wsdl"/>
      
       <xsd:complexType name="EmploymentHistory">
       <xsd:sequence>
       <xsd:element name="fundCode" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="employerNumber" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="tradingName" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="employerStatus" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="startDate" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="endDate" nillable="true" type="xsd:string" minOccurs="0"/>
       </xsd:sequence>
       </xsd:complexType>
       <xsd:complexType name="MemberPackages">
       <xsd:sequence>
       <xsd:element name="packageName" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="packageStartDate" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="packageEndDate" nillable="true" type="xsd:string" minOccurs="0"/>
       </xsd:sequence>
       </xsd:complexType>
      
       <xsd:complexType name="GetMemberInfoRequestType">
       <xsd:sequence>
       <xsd:element ref="edm:getMemberInfo"/>
       <xsd:any processContents="lax"/>
       </xsd:sequence>
       <xsd:anyAttribute processContents="lax"/>
       </xsd:complexType>
       <xsd:complexType name="GetMemberInfoRequest">
       <xsd:sequence>
       <xsd:element name="fundCode" nillable="true" type="xsd:string"/>
       <xsd:element name="memberNumber" nillable="true" type="xsd:string"/>
       </xsd:sequence>
       </xsd:complexType>
       <xsd:complexType name="GetMemberInfoResponseType">
       <xsd:sequence>
       <xsd:element ref="edm:getMemberInfoResponse"/>
       <xsd:any processContents="lax"/>
       </xsd:sequence>
       <xsd:anyAttribute processContents="lax"/>
       </xsd:complexType>
       <xsd:complexType name="GetMemberInfoResponse">
       <xsd:sequence>
       <xsd:element name="fundCode" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="clientArrangementId" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="memberNumber" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="membershipType" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="title" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="givenName" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="surname" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="gender" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="email" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="phoneNumber" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="dateOfBirth" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="deemedDate" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="activeDate" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="addressLine1" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="addressLine2" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="addressLine3" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="suburb" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="state" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="postcode" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="country" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="accountBalance" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="division" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="status" nillable="true" type="xsd:string" minOccurs="0"/>
       <xsd:element name="employmentHistory" type="tns:EmploymentHistory" nillable="true" maxOccurs="unbounded" minOccurs="0"/>
       <xsd:element name="mbrPackages" type="tns:MemberPackages" nillable="true" maxOccurs="unbounded" minOccurs="0"/>
       </xsd:sequence>
       </xsd:complexType>
       </xsd:schema>
      
       </wsdl:types>
      
       <wsdl:message name="getMemberInfoIn">
       <wsdl:part name="getMemberInfo" element="tns:getMemberInfo"/>
       </wsdl:message>
      
       <wsdl:message name="getMemberInfoOutput">
       <wsdl:part name="getMemberInfoResponse" element="tns:getMemberInfoResponse"/>
       </wsdl:message>
      
       <wsdl:portType name="Insurance_services_getmemberinfo">
       <wsdl:operation name="getMemberInfo">
       <wsdl:input message="tns:getMemberInfoIn"/>
       <wsdl:output message="tns:getMemberInfoOutput"/>
       </wsdl:operation>
       </wsdl:portType>
       <wsdl:binding name="Insurance_services_getmemberinfoBinding" type="tns:Insurance_services_getmemberinfo">
       <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
      
       <wsdl:operation name="getMemberInfo">
       <soap:operation soapAction=""/>
       <wsdl:input>
       <soap:body use="literal"/>
       </wsdl:input>
       <wsdl:output>
       <soap:body use="literal"/>
       </wsdl:output>
       </wsdl:operation>
       </wsdl:binding>
       <!-- to test point web browser too
      
       <wsdl:service name="Insurance_services_getmemberinfoService">
       <wsdl:port name="Insurance_services_getmemberinfoPort0" binding="tns:Insurance_services_getmemberinfoBinding">
       <soap:address location="http://localhost:5565/soap/DocLiteral"/>
       </wsdl:port>
       </wsdl:service>
       </wsdl:definitions>
      
      
      
      


      I have not been able to understand what the problem is. Even though the stubs are generated, I'm not sure whether these are right ones, because their was warning which is coming all the time when i run wsconsume.

      Any pointers or hints will be a great help.

      I went further assuming thet "let us not worry about the warning" and tried to rune the cleint using generated stubs and i got this error at invocation of this service

      Exception in thread "main" java.lang.IllegalStateException: Cannot build JAXB context
       at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.createJAXBContext(JAXWSMetaDataBuilder.java:879)
       at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.rebuildEndpointMetaData(JAXWSClientMetaDataBuilder.java:281)
       at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPortInternal(ServiceDelegateImpl.java:274)
       at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPort(ServiceDelegateImpl.java:200)
       at javax.xml.ws.Service.getPort(Service.java:116)
       at au.com.sydney.InsuranceServicesGetmemberinfoService.getInsuranceServicesGetmemberinfoPort0(InsuranceServicesGetmemberinfoService.java:56)
       at au.com.sydney.TestService.main(TestService.java:28)
      Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 32 counts of IllegalAnnotationExceptions
      There's no ObjectFactory with an @XmlElementDecl for the element {http://www.myhome.com.au/insurance.doc.wsdl}fundCode.
       this problem is related to the following location:
       at protected javax.xml.bind.JAXBElement au.com.sydney.GetMemberInfoResponse.fundCode
       at au.com.sydney.GetMemberInfoResponse
      


      As i get this run time error... I'm not sure now whether its a stub generated by wsconsume are not right because their was a warning while running wsconsume or is it JAXB or something else.

      Any pointers to work on will be a geart help and save me :) from stress over the weekend.








        • 1. Re: Wsconsume generated Stubs failing with JBoss-4.2.0

          The comilation error i get is this ... whne i run wsconsume....


          :resources$ /cygdrive/d/javadev/jboss-4.2.0.GA/bin/wsconsume.sh -k -t -p au.com.tusc getMemberInfo.wsdl
          warning: src-resolve: Cannot resolve the name 'edm:getMemberInfo' to a(n) 'e lement declaration' component.
           line ? of file:/C:/cygwin/home/vishal/download/source.new/common/resources /getMemberInfo.wsdl#types?schema2
          au\com\tusc\EmploymentHistory.java
          au\com\tusc\GetMemberInfoRequest.java
          au\com\tusc\GetMemberInfoRequestType.java
          au\com\tusc\GetMemberInfoResponse.java
          au\com\tusc\GetMemberInfoResponseType.java
          au\com\tusc\InsuranceServicesGetmemberinfo.java
          au\com\tusc\InsuranceServicesGetmemberinfoService.java
          au\com\tusc\MemberPackages.java
          au\com\tusc\ObjectFactory.java
          au\com\tusc\package-info.java
          au\com\tusc\EmploymentHistory.java
          au\com\tusc\GetMemberInfoRequest.java
          au\com\tusc\GetMemberInfoRequestType.java
          au\com\tusc\GetMemberInfoResponse.java
          au\com\tusc\GetMemberInfoResponseType.java
          au\com\tusc\InsuranceServicesGetmemberinfo.java
          au\com\tusc\InsuranceServicesGetmemberinfoService.java
          au\com\tusc\MemberPackages.java
          au\com\tusc\ObjectFactory.java
          au\com\tusc\package-info.java
          
          


          • 2. Re: Wsconsume generated Stubs failing with JBoss-4.2.0
            thomas.diesler

            what jbossws is this?

            • 3. Re: Wsconsume generated Stubs failing with JBoss-4.2.0

              Hi Thomas,

              Thanks for replying. I'm not sure what version JBossWS it is. I'm using
              JBoss-4.2.0.GA/ distribution, what version is shipped with it is not clear to me.

              • 4. Re: Wsconsume generated Stubs failing with JBoss-4.2.0
                thomas.diesler

                please try jbossws-2.0.1

                • 5. Re: Wsconsume generated Stubs failing with JBoss-4.2.0
                  m_schumpa

                  you can see which version of JBossWS is loaded at startup of JBoss. I should look something like this:
                  INFO [ServiceEndpointManager] jbossws-1.2.1.GA (build=200704151756)

                  That's the message from JBoss-4.2.0.GA/ distribution, so I think you are also using this one.

                  • 6. Re: Wsconsume generated Stubs failing with JBoss-4.2.0

                    Hi Thomas,

                    I have got the new Web services stack (jbossws-2.0.1.GA) and deployed it
                    in Jboss 4.2.1.GA and wsconsume fails with it as well

                    I have validated my WSDL file (using WTP in Eclipse 3.3) as well and doesnt complain at all.

                    To me its a bug in stack, which is generating wrong input paramaeter for the interface.
                    It generates the right response for return type but fails with input type.
                    This is what i get when i use wsconsume.

                    vsm@jm000606:resources$ ~/javadev/jboss-4.2.1.GA/bin/wsconsume.sh -p au.com.new201 -k getMemberInfo.wsdl
                    JBossWS-Native stack deployed
                    parsing WSDL...


                    [

                    WARNING] src-resolve: Cannot resolve the name 'edm:getMemberInfo' to a(n) 'element declaration' component.
                     line 52 of file:/C:/cygwin/home/vishal/download/source.new/common/resources/getMemberInfo.wsdl#types?schema2
                    
                    generating code...
                    au\com\new201\EmploymentHistory.java
                    au\com\new201\GetMemberInfoRequest.java
                    au\com\new201\GetMemberInfoRequestType.java
                    au\com\new201\GetMemberInfoResponse.java
                    au\com\new201\GetMemberInfoResponseType.java
                    au\com\new201\InsuranceServicesGetmemberinfo.java
                    au\com\new201\InsuranceServicesGetmemberinfoService.java
                    au\com\new201\MemberPackages.java
                    au\com\new201\ObjectFactory.java
                    au\com\new201\package-info.java
                    vsm@jm000606:resources$



                    • 7. Re: Wsconsume generated Stubs failing with JBoss-4.2.0

                      Hi Thomas,
                      It looks to me wsdl to java generation for complex types is not corrcet in JBoss ws stack at all.

                      I'm certain now its a bug in implementation.
                      I have tried to hack the wsdl to work properly but then it generates wrong soap packet or wrong interface (without wrappers) for client.

                      • 8. Re: Wsconsume generated Stubs failing with JBoss-4.2.0
                        thomas.diesler
                        • 9. Re: Wsconsume generated Stubs failing with JBoss-4.2.0
                          heiko.braun

                          What you see is WARNING from JAXP. However the classes are correctly generated. I'll close the issue.