axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravi Kumar <rku...@borland.com>
Subject Re: Wsdl importer and Overload
Date Fri, 30 Nov 2001 02:27:37 GMT
comments below

Russell Butek wrote:

> Yes, this is a "yet to be implemented" feature.  It's not even on my radar
> at the moment.  Should it be?
>

I really don't know as regards to the priority of this feature.
I wonder if any of the Interop's use this.

>
> There's a sequel to this question that you may or may not want to hear.
>
> This is an ugly point about JAX-RPC.  We cannot go from Java->WSDL->Java
> because of this.

Ceratinly, this is on my TODO, though it's way too early for Java2Wsdl to
venture into this. We will discuss this a little later, particularly with
regards to stashing away "out of band" info such as mangling, type registry,
etc

But any way, as regards to the JAX-RPC stuff ....

> Why would we want to?  Easy.  Say we have an existing EJB
> on the server we wish to export as a web service.  To export it, we'd have
> to generate WSDL from the existing Java so that a client can later generate
> Java bindings from that WSDL.  JAX-RPC says in section 4.3.4:
>
> "Note that the WSDL 1.1 specification does not require that operation names
> be unique.  This supports overloaded operations. Overloaded operations are
> mapped to overloaded Java methods provided the overloading does not cause
> any conflicts in the mapped Java interface declaration and follows the Java
> Language specification [1]."
>
> And later in section 5.4.5:
>
> "Overloaded Java methods are mapped to multiple wsdl:operation elements
> with unique names. A Java to WSDL mapping tool is required to map
> overloaded Java methods to the wsdl:operation definitions with unique
> names."
>

Hmm, why is this required? Why can't we generate a WSDL with the same operation
name, but pointing to different inputs? What is the JAX-RPC rationale?

It's one thing when there is type promotion involved and so the signatures are
not distinguishable - but otherwise, there is no need to require mangling or is
there?

Regards
Ravi

>
> So if a Java service has two X methods, one with parameters A and B and the
> other with parameter C, then to generate WSDL from this we have to somehow
> mangle the names, say X_A_B and X_C.  Then when we get the Java stub for
> this WSDL we'll have operations X_A_B and X_C, not 2 X operations.  Boom.
>
> There is a similar problem if a Java method has a java.lang.Integer
> parameter (or other primitive type wrapper).  JAX-RPC says Java Integer
> maps to XML xsd.int, but xsd.int maps to Java int.  Boom.
>
> Russell Butek
> butek@us.ibm.com
>
> Ravi Kumar <rkumar@borland.com> on 11/29/2001 04:40:44 PM
>
> Please respond to axis-dev@xml.apache.org
>
> To:   axis-dev <axis-dev@xml.apache.org>
> cc:
> Subject:  Wsdl importer and Overload
>
> Russell, Tom,
>
> May be this "yet to be implemented". But just in case:
>
> The attached WSDL uses operation overloading.
> The WSDL exporter generates erroneous code
>
> Rgds
> Ravi
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <definitions name="fooDescription"
>      targetNamespace="http://tempuri.org/wsdl/"
>      xmlns:wsdlns="http://tempuri.org/wsdl/"
>      xmlns:typens="http://tempuri.org/xsd"
>      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>      xmlns:stk="http://schemas.microsoft.com/soap-toolkit/wsdl-
>             extension"
>      xmlns="http://schemas.xmlsoap.org/wsdl/">
> <types>
>      <schema targetNamespace="http://tempuri.org/xsd"
>               xmlns="http://www.w3.org/2001/XMLSchema"
>               xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>                     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>            elementFormDefault="qualified" >
> </schema>
> </types>
>
> <message name="foo1">
>      <part name="arg" type="xsd:int"/>
> </message>
>
> <message name="foo2">
>      <part name="arg" type="xsd:string"/>
> </message>
>
> <portType name="fooSamplePortType">
>      <operation name="foo">
>           <input name="foo1" message="wsdlns:foo1"/>
>      </operation>
>      <operation name="foo">
>           <input name="foo2" message="wsdlns:foo2"/>
>      </operation>
> </portType>
>
> <binding name="fooSampleBinding" type="wsdlns:fooSamplePortType">
> <stk:binding preferredEncoding="UTF-8" />
>      <soap:binding style="rpc"
>             transport="http://schemas.xmlsoap.org/soap/http"/>
>      <operation name="foo">
>      <soap:operation soapAction="http://tempuri.org/action/foo1"/>
>           <input name="wsdlns:foo1">
>      <soap:body use="encoded" namespace="http://tempuri.org/message/"
>       encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
>      </input>
> </operation>
> <operation name="foo">
>      <soap:operation soapAction="http://tempuri.org/action/foo2"/>
>           <input name="wsdlns:foo2">
>                <soap:body use="encoded"
>                namespace="http://tempuri.org/message/"
>                encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>                />
>           </input>
> </operation>
> </binding>
>
>      <service name="FOOService">
>           <port name="fooSamplePort" binding="wsdlns:fooSampleBinding">
>                <soap:address
>                   location="http://carlos:8080/fooService/foo.asp"/>
>           </port>
>      </service>
> </definitions>

Mime
View raw message