1 Reply Latest reply on Jun 6, 2006 3:53 AM by Eric Rajkovic-Oracle

    WSDL failing on WS-I analyze with BP2012

    Jgrocock-Oracle
      Hi,
      I am quite new to the WS-I analizer and it is failing with a BP2012 error which relates to "The binding (in soapbind:body elements) refers to part(s) of a soap:body element that do not have the "element" attribute.".

      I have the following WSDL

      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name="ProductService"
      targetNamespace="http://www.ecerami.com/wsdl/ProductService.wsdl"
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:tns="http://www.ecerami.com/wsdl/ProductService.wsdl"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsd1="http://www.ecerami.com/schema">

      <types>
      <xsd:schema
      targetNamespace="http://www.ecerami.com/schema"
      xmlns="http://www.w3.org/2001/XMLSchema"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
      <xsd:complexType name="product">
      <xsd:sequence>
      <xsd:element name="name" type="xsd:string"/>
      <xsd:element name="description" type="xsd:string"/>
      <xsd:element name="price" type="xsd:double"/>
      <xsd:element name="SKU" type="xsd:string"/>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:schema>
      </types>

      <message name="getProductRequest">
      <part name="sku" type="xsd:string"/>
      </message>

      <message name="getProductResponse">
      <part name="product" type="xsd1:product"/>
      </message>

      <portType name="Product_PortType">
      <operation name="getProduct">
      <input message="tns:getProductRequest"/>
      <output message="tns:getProductResponse"/>
      </operation>
      </portType>
      <binding name="ProductPortBinding" type="tns:Product_PortType">
      <soap:binding style="document"
      transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="getProduct">
      <soap:operation soapAction="http://www.ecerami.com/wsdl/ProductService.wsdl/getProduct"/>
      <input>
      <soap:body use="literal" parts="sku"/>
      </input>
      <output>
      <soap:body use="literal" parts="product"/>
      </output>
      </operation>
      </binding>
      <service name="NewProductService">
      <port name="NewProductPortBinding" binding="tns:ProductPortBinding">
      <soap:address location="http://blah"/>
      </port>
      </service>
      </definitions>

      Can anyone point me in the right direction so that I can use the complexType and pass the WS-I checks?

      Thanks
      Joel.
        • 1. Re: WSDL failing on WS-I analyze with BP2012
          Eric Rajkovic-Oracle
          Hi Joel,

          When using document/literal message format, the <soap:part> should be referencing an element. types are only valid for RPC message format (either RPC/encoded or RPC/literal).

          <part name="sku" type="xsd:string"/> is only valid for RPC.

          The best way to learn how to author WSDL is to start with java code ans see how tools like JDeveloper or WSA do it.

          Here, your parts need to point at an element. Here is a sample for the output (same applies for the input):

          <xsd:element name="product" type="xsd1:product"/>
          ...
          <message name="getProductResponse">
          <part name="product" element="xsd1:product"/>
          </message>

          The name of the newly introduced element can be anything you want it to be.

          Hope it helps,
          --eric