3 Replies Latest reply on Sep 11, 2007 9:26 AM by maffewl

    wsconsume schema type reference problem

    gryffin

      I'm using wsconsume to build the server classes necessary for a top-down implementation of a ws. I get an error that seems to indicate it can't find the type description, but it's there.

      C:\wsdev\jboss2>wsconsume -k -p com.boeing.nmt.server.ws -o gen -s src NlsSoap.wsdl
      Invalid wsdl:operation "AssetAssociationSet": its a rpc-literal operation, message part must refer
      to a schema type declaration
       at org.jboss.com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.fail(WSDLModeler.java:2788)
      


      Excerpt from WSDL binding:
      <binding name="NlsSoapBinding" type="y:SOAPport">
       <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
       <operation name="AssetAssociationSet">
       <soap:operation soapAction="urn:#AssetAssociationSet" style="rpc"/>
      ...
      


      Excerpt from portType:
       <portType name="SOAPport">
       <operation name="AssetAssociationSet">
       <input message="y:AssetAssociationSetSoapIn"/>
       <output message="y:AssetAssociationSetSoapOut"/>
      ...
      


      Excerpt from message:

       <message name="AssetAssociationSetSoapIn">
       <part name="Selector" element="ns1:AssetSelector"/>
       <part name="AssociationValues" element="ns1:AssociationValues"/>
       </message>
       <message name="AssetAssociationGetSoapIn">
       <part name="Selector" element="ns1:AssetSelector"/>
       </message>
      ...
      


      Excerpt from schema:

       <xs:element name="AssetSelector">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="AssetId" type="xs:string"/>
       <xs:element name="OwnerAppId" type="xs:string" minOccurs="0"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       <xs:element name="AssociationValues">
       <xs:complexType>
       <xs:sequence>
      ...
      


      Is there some mistake in the WSDL parts shown that prevent wsconsume from matching the schema type with the binding? To me, it looks good. Thanks.

        • 1. Re: wsconsume schema type reference problem
          maffewl

          bump, i'm having the same issue, any thoughts?

          • 2. Re: wsconsume schema type reference problem

            I thnk by the look of it , the iisue is how yr mthod name and inpout raument name are different.
            According to new spech JSr-224 which is what is used for these tools, yr method name should be same as input arguement name.

            Please read the spec and you will discover more, new spec is very pedantic about these conventions.


            I have enclosed a WSDL for Doc/Lit wraped style of service to give you hints, this works with Wsconsume

            <?xml version="1.0" encoding="UTF-8"?>
            <wsdl:definitions name="matt_HelloWorld3"
             targetNamespace="http://www.superpartners.com.au/matt.HelloWorld3"
             xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
             xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:tns="http://www.superpartners.com.au/matt.HelloWorld3">
             <wsdl:types>
            
             <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             targetNamespace="http://www.superpartners.com.au/matt.HelloWorld3"
             xmlns:edm="http://www.superpartners.com.au/matt.HelloWorld3">
            
             <xsd:element name="HelloWorld" type="edm:HelloWorldReq" />
            
             <xsd:complexType name="HelloWorldReq">
             <xsd:sequence>
             <xsd:element minOccurs='0' name='id'
             type='xsd:string' />
             </xsd:sequence>
             </xsd:complexType>
            
             <xsd:element name="HelloWorldResponse"
             type="edm:HelloWorldRespons" />
            
             <xsd:complexType name="HelloWorldRespons">
             <xsd:sequence>
             <xsd:element minOccurs='0' name='result'
             type='xsd:string' />
             </xsd:sequence>
             </xsd:complexType>
             </xsd:schema>
            
             </wsdl:types>
            
             <wsdl:message name="HelloWorldIn">
             <wsdl:part name="HelloWorld" element="tns:HelloWorld" />
             </wsdl:message>
            
             <wsdl:message name="HelloWorldOutput">
             <wsdl:part name="HelloWorldResponse"
             element="tns:HelloWorldResponse" />
             </wsdl:message>
            
             <wsdl:portType name="matt_HelloWorld3PortType">
             <wsdl:operation name="HelloWorld">
             <wsdl:input message="tns:HelloWorldIn" />
             <wsdl:output message="tns:HelloWorldOutput" />
             </wsdl:operation>
             </wsdl:portType>
            
             <wsdl:binding name="matt_HelloWorld3Binding"
             type="tns:matt_HelloWorld3PortType">
             <soap:binding style="document"
             transport="http://schemas.xmlsoap.org/soap/http" />
             <wsdl:operation name="HelloWorld">
             <soap:operation soapAction="" />
             <wsdl:input>
             <soap:body use="literal" />
             </wsdl:input>
             <wsdl:output>
             <soap:body use="literal" />
             </wsdl:output>
             </wsdl:operation>
             </wsdl:binding>
            
             <wsdl:service name="matt_HelloWorld3Service">
             <wsdl:port name="matt_HelloWorld3Port0"
             binding="tns:matt_HelloWorld3Binding">
             <soap:address
             location="http://spthd01:5565/soap/DocLiteral" />
             </wsdl:port>
             </wsdl:service>
            </wsdl:definitions>



            • 3. Re: wsconsume schema type reference problem
              maffewl

              R2203 of the Basic Profile standard (http://www.ws-i.org/Profiles/BasicProfile-1.2.html) states: 'An rpc-literal binding in a DESCRIPTION MUST refer, in its soapbind:body element(s), only to wsdl:part element(s) that have been defined using the type attribute'

              where you say:

              <wsdl:message name="HelloWorldIn">
               <wsdl:part name="HelloWorld" element="tns:HelloWorld" />
               </wsdl:message>


              in rpc-literal it should be

              <wsdl:message name="HelloWorldIn">
               <wsdl:part name="HelloWorld" type="tns:sometype" />
               </wsdl:message>


              Axis I noticed is lenient on this rule, but JBossWS seems pretty strict about it.