You need to define an element in your schema (rather than just a
type), and reference this element from your <part> description. You
need to do the same for your input message. And rather than using the
unwrapped document style, I recommend that you use the wrapped
document style, which means that you should define input and output
wrapper elements"

<xsd:schema targetNamespace="urn:listing2"
xmlns:listing3="urn:listing3"
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
  <xsd:import namespace="urn:listing3" schemaLocation="listing3.xsd" /> 
  <xsd:element name="getPhone">
    <xsd:complexType>
       <xsd:sequence>
         <xsd:element name="name" type="xsd:string"/>
       </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:element name="getPhoneReturn">
    <xsd:complexType>
       <xsd:sequence>
         <xsd:element name="phone" type="listing3:Phone"/>
       </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
 </xsd:schema>

  <wsdl:message name="GetPhoneRequest">
     <wsdl:part name="parameters" element="tns:getPhone" /> 
  </wsdl:message>
  <wsdl:message name="GetPhoneResponse">
     <wsdl:part name="parameters" element="tns:getPhoneReturn" /> 
   </wsdl:message>

Anne
On 6/21/05, Z Ellmy <[EMAIL PROTECTED]> wrote:
> I'm trying to compose a valid doc/literal WSDL but I'm having trouble.
> 
> If I use:
> <wsdl:part name="phone" type="listing3:Phone"/>
> 
> this works and I can generate stubs and bindings but SOAPScope and
> other tools clue me that this violates WS-I Basic Profile:
> 
>   Missing "element" attribute - Wsdl:part phone does not have an "element"
>   attribute defined and is referred to by a "document" style soap:body.
> 
> So, if I change this to:
> <wsdl:part name="phone" element="listing3:Phone"/>
> 
> then I get an error with wsdl2java:
>   WSDL processing error for AddressBook.wsdl : Element {urn:listing3}Phone
>   is referenced but not defined.
> 
> So I guess my question is what is the correct way to import this type
> from another schema file and still satisfy the WS-I requirements? This
> is just a basic example, my "real" problem involves creating a WSDL
> for an existing set of complex schemas.
> 
> I've attached my WSDL and my XSD.
> 
> I'll be the first to admit any ignorance and/or misunderstand of the
> concepts here -- but I'd really appreciate some help :

Reply via email to