axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anne Thomas Manes" <a...@manes.net>
Subject RE: WSDL2Java and Basic Profile
Date Wed, 13 Oct 2004 09:39:57 GMT
Interesting. I think you found a bug in the WS-I Basic Profile.
According to the WSDL 1.1 specification [1] and the latest version of the
WSDL 1.1 XML Schema [2], the definitions/binding/operation/input element
does not include the @message attribute. Therefore the sample in the WS-I
Basic Profile is in error. 

[1] http://www.w3.org/TR/wsdl#_bindings 
[2] http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd

You need to remove the @message attributes from your <input> and <output>
definitions in your <binding> definitions. 

Also, note that the example you referenced is for RPC style services, but
you've written a Document style service. When writing a Document style
service you must NOT include the namespace attribute:

R2716 A document-literal binding in a DESCRIPTION MUST NOT have the
namespace attribute specified on contained soapbind:body, soapbind:header,
soapbind:headerfault and soapbind:fault elements.

Also, when using Document style, your message <part> definitions must
reference an element rather than a type. 

R2204 A document-literal binding in a DESCRIPTION MUST refer, in each of its
soapbind:body element(s), only to wsdl:part element(s) that have been
defined using the element attribute. 

Try this WSDL:

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

  <wsdl:types>
    <xsd:schema targetNamespace="http://cityxpress.com/external">
      <xsd:element name="getObject" type="GetObjectType"/>
       <xsd:complexType name="GetObjectType">
        <xsd:sequence>
          <xsd:element name="id" type="xsd:string"/>
        </xsd:secquence>
      </xsd:complexType> 
      <xsd:element name="getObjectReturn" type="CXObjectType"/>      
      <xsd:complexType name="CXObjectType">
        <xsd:sequence>
          <xsd:element name="thedate" type="xsd:dateTime"/>
          <xsd:element name="avalue" type="xsd:int"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="getObjectRequest">
    <wsdl:part name="parameters" element="tns:getObject"/>
  </wsdl:message>
  <wsdl:message name="getObjectResponse">
    <wsdl:part name="parameters" type="tns:getObjectReturn"/>
  </wsdl:message>
  <wsdl:portType name="XMTestPortType">
    <wsdl:operation name="getObject">
      <wsdl:input message="tns:getObjectRequest"/>
      <wsdl:output message="tns:getObjectResponse"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="XMTestBinding" type="tns:XMTestPortType">
    <soap:binding style="document"
      transport="http://schemas.xmlsoap.org/soap/http/"/>
    <wsdl:operation name="getObject">
      <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="XMTest">
    <wsdl:port name="XMTest" binding="tns:XMTestBinding">
      <soap:address location="http://localhost:8080/v01/XMTest"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

Regards,
Anne

-----Original Message-----
From: Dan Ciarniello [mailto:dciarniello@cityxpress.com] 
Sent: Saturday, October 09, 2004 12:08 AM
To: axis-user@ws.apache.org
Subject: WSDL2Java and Basic Profile

I am trying to follow the advice that I've seen in this mailing list by 
handcrafting a WSDL and feeding it to WSDL2Java.  I'm also trying to 
make it conform to the WS-I Basic Profile requirements.  Unfortunately, 
I'm running into problems.

When I run WSDL2Java, I this:

WSDLException (at 
/wsdl:definitions/wsdl:binding/wsdl:operation/wsdl:input): 
faultCode=INVALID_WSDL: Encountered illegal extension attribute 
'message'. Extension attributes must be in a namespace other than WSDL's.:

There may be a problem with my WSDL (see below) but I also grabbed the 
WS-I sample WSDL found at

http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html#Namespaces_for
_Children_of_Part_Accessors

This gives exactly the same error.

It seems a bit odd that a "CORRECT" WSDL from the WS-I site should not 
be considered valid.

Here's my WSDL:

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

  <wsdl:types>
    <xsd:schema targetNamespace="http://cityxpress.com/external">
      <xsd:complexType name="CXObjectType">
        <xsd:sequence>
          <xsd:element name="thedate" type="xsd:dateTime"/>
          <xsd:element name="avalue" type="xsd:int"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="getObjectRequest">
    <wsdl:part name="id" type="xsd:string"/>
  </wsdl:message>
  <wsdl:message name="getObjectResponse">
    <wsdl:part name="getObjectReturn" type="tns:CXObjectType"/>
  </wsdl:message>
  <wsdl:portType name="XMTestPortType">
    <wsdl:operation name="getObject">
      <wsdl:input message="tns:getObjectRequest"/>
      <wsdl:output message="tns:getObjectResponse"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="XMTestBinding" type="tns:XMTestPortType">
    <soap:binding style="document"
      transport="http://schemas.xmlsoap.org/soap/http/"/>
    <wsdl:operation name="getObject">
      <soap:operation soapAction=""/>
      <wsdl:input message="tns:getObjectRequest">
        <soap:body namespace="http://cityxpress.com/external" 
use="literal"/>
      </wsdl:input>
      <wsdl:output message="tns:getObjectResponse">
        <soap:body namespace="http://cityxpress.com/external" 
use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="XMTest">
    <wsdl:port name="XMTest" binding="tns:XMTestBinding">
      <soap:address location="http://localhost:8080/v01/XMTest"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

If anyone can point out the problem, it would be greatly appreciated.

Thanks,
Dan.




Mime
View raw message