You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Charles Roy <cr...@blueprint.org> on 2004/08/18 19:55:54 UTC

WSDL2Java overloading functions

Hi,

Is it possible to overload methods and use the WSDL2Java tool to 
generate the stubs for the overloaded methods.

Thanks,
Charles



Re: WSDL2Java overloading functions

Posted by Charles Roy <cr...@blueprint.org>.
Yes, right now it's rpc/enc.

The overloading is a management decision for me - there's really no 
flexibility despite talking about some of these issues.

Definitely important points for others to consider before doing it though.

Thanks,
Charles

Nelson Minar wrote:

>>Is it possible to overload methods and use the WSDL2Java tool to 
>>generate the stubs for the overloaded methods.
>>    
>>
>
>It may work, but it's probably a bad idea. WS-I Basic Profile
>explicitly forbids overloading methods. And I wouldn't count on
>interop on other platforms. You said elsewhere you were doing
>rpc/encoded, though, so maybe you don't care.
>  
>



Re: WSDL2Java overloading functions

Posted by Nelson Minar <ne...@monkey.org>.
>Is it possible to overload methods and use the WSDL2Java tool to 
>generate the stubs for the overloaded methods.

It may work, but it's probably a bad idea. WS-I Basic Profile
explicitly forbids overloading methods. And I wouldn't count on
interop on other platforms. You said elsewhere you were doing
rpc/encoded, though, so maybe you don't care.

Re: WSDL2Java overloading functions

Posted by Steve Piercey <pi...@xyenterprise.com>.
Yes, you are right. I'm using rpc/encoding. I'll have to keep the doc/lit
stuff  in mind. For now, rpc does the job for me

Steve


----- Original Message ----- 
From: "Anand Natrajan" <an...@cs.virginia.edu>
To: <ax...@ws.apache.org>
Sent: Wednesday, August 18, 2004 3:40 PM
Subject: Re: WSDL2Java overloading functions


> Charles and Steve,
>
> Mostly for my curiousity, are you using an rpc/encoded service or a
> document/literal service? My information may be wrong, but I believe the
> latter doesn't support overloaded methods. Given that the web services
> world is moving to doc/lit, having overloaded methods may be ill-advised
> for future compatibility.
>
> Anand
>
> On Wed, 18 Aug 2004, Charles Roy wrote:
>
> : Thanks Steve,
> :
> : Got it now on the same setup.
> :
> :
> : Looks like the problem was in the WSDL file.
> : Explicitly setting the name attribute of the operation within the
> : binding and then have it correspond to the name attribute of the input
> : in the corresponding portType operation fixed it.
> :
> : XMLSpy v5 r2 messed up my WSDL file when adding overloading methods and
> : I cannot seem to specify the name attribute in the binding operations
> : using it, but after fixing the WSDL file by hand it works.
> :
> : Thanks,
> : Charles
> :
> : Steve Piercey wrote:
> :
> : >It works for me in Axis 1.1 with Tomcat 5
> : >
> : >Steve
> : >.
> : >
> : >----- Original Message -----
> : >From: "Charles Roy" <cr...@blueprint.org>
> : >To: <ax...@ws.apache.org>
> : >Sent: Wednesday, August 18, 2004 1:55 PM
> : >Subject: WSDL2Java overloading functions
> : >
> : >
> : >
> : >
> : >>Hi,
> : >>
> : >>Is it possible to overload methods and use the WSDL2Java tool to
> : >>generate the stubs for the overloaded methods.
> : >>
> : >>Thanks,
> : >>Charles
> : >>
> : >>
> : >>
> : >>
> : >>
> :
> :
> :
>


Re: WSDL2Java overloading functions

Posted by Elliot Metsger <em...@jhu.edu>.
Anand:

Many thanks for the summary!


Anand Natrajan wrote:

<snip>

> doc/lit of course decouples the request/response from a procedural model on
> the server side, which is nice and fine philosophically, but practically,
> doesn't affect me much. I suspect it doesn't affect many others as well,
> especially those persisting with rpc/enc services.

I used rpc/lit for a couple of related reasons:
1. IDE integration
2. It seemed to me that the WSDL was more descriptive.  wsdl:operations 
taking these data types with this return etc etc.

If I go doc/lit, it seems that the WSDL becomes less descriptive; using 
a Document instead.  I presume then that XML schema is used to describe 
what belongs in the Document

<snip>

Thanks for re-hashing what as probably been rehashed to death by now :)

Since it seems that doc/lit is the way to go, and since I'm in the 
middle of developing my web service, I'll convert over to doc/lit, Axis 
1.2 and try it out :)

Regards,
Elliot

Re: WSDL2Java overloading functions

Posted by Anand Natrajan <an...@cs.virginia.edu>.
Elliot,

In general, reducing functionality will raise interoperability issues - that
observation applies to the deprecation of rpc/literal as well.

Given the two major style/usage combinations, i.e., rpc/encoded and
document/literal, the latter seems to me a superior model mainly because all
references to types are local (as intended, of course). I've swung much more
in favour of document/literal especially after Axis 1.2 has strengthened its
support for it.

doc/lit of course decouples the request/response from a procedural model on
the server side, which is nice and fine philosophically, but practically,
doesn't affect me much. I suspect it doesn't affect many others as well,
especially those persisting with rpc/enc services.

As for the "hybrids", rpc/lit and doc/enc (yes, I know they're orthogonal
combinations, not really hybrids), the rationale for using them has always
been thin, so lopping them off in the newer standard seems fine. Yes, it
hurts interoperability, but keeping 4 combinations around could have far
worse longer-term consequences for web services as a whole - a classic case
where the needs of a few must be sacrificed for the needs of the many.

Anand

On Wed, 18 Aug 2004, Elliot Metsger wrote:

: Anand et. al,
:
: Can you offer your perspective on the interoperability of rpc/lit in the
: future?  Dosen't the WS-I Basic Profile 1.0 go a ways to reducing
: opportunities for interoperability issues?
:
: Thanks,
: Elliot (a ws newbie)
:
: Anand Natrajan wrote:
: > Charles and Steve,
: >
: > Mostly for my curiousity, are you using an rpc/encoded service or a
: > document/literal service? My information may be wrong, but I believe the
: > latter doesn't support overloaded methods. Given that the web services
: > world is moving to doc/lit, having overloaded methods may be ill-advised
: > for future compatibility.
: >
: > Anand

RE: WSDL2Java overloading functions

Posted by Anne Thomas Manes <an...@manes.net>.
WS-I BP does allow rpc/literal, but Microsoft refuses to support it. Also,
SOAP 1.2 makes support for the RPC convention optional. I take these two
facts as an indication that rpc/literal has no future.

Note that rpc/encoded and rpc/literal are extremely different creatures. The
SOAP RPC convention is very much dependent on the SOAP encoding data model
(design to represent object graphs). The WSDL rpc/literal style is dependent
on XML schema (designed to represent tree structures), and it's designed as
a "convenient subset" of doc/literal. Personally I don't think it adds all
that much convenience because the tooling should generate your WSDL and
schema definitions for you. I view not having a schema of the message
structure as much more of an inconvenience.

As Marc Hadley (Sun rep to W3C XMLP) explained to me:
<atm> my comments in brackets </atm>

<marcHadleyExplanation>
"The main difference is in the data model that underlies the two. SOAP
encoding is built on a directed edge-labeled graph whereas rpc/literal is
built on a tree structure. WSDL rpc/encoded uses XML schema to describe the
abstract types of operation parameters rather than their actual serialized
form (SOAP encoding does that). 
</marcHadleyExplanation>
  <atm> 
    For each node in the serialized message, SOAP encoding will 
    generate either an element or a reference to an element. 
  </atm> 
<marcHadleyExplanation>
rpc/literal is really just a convenient subset of document/literal where XML
schema is used to describe the serialized form of an operation's parameter
types but not the serialization of the so called wrapper elements that
represent the operations themselves. 
</marcHadleyExplanation>
  <atm> 
    Note that in rpc/literal the XML schema defines the serialized form 
    of the parameter *types*, but not of the parameter *elements*. My
    objection to using rpc/literal is that you don't have a schema of 
    the actual message structure, only of various complex types within 
    the message structure, so message validation is much more complicated. 
  </atm> 
<marcHadleyExplanation>
You could use rpc/literal or document/literal to describe the serialization
of a directed edge labelled graph but it requires each node in the tree to
be a choice between a value or a reference to a value and this gets pretty
ugly pretty quickly."
</marcHadleyExplanation>

And just to finish off the thought -- wrapped doc/literal produces a very
close approximation of rpc/literal, except that you must use XML schema to
describe the operation's wrapper element and all of the actual parameter
elements. I say "approximation" because in wrapped doc/literal, you may want
to namespace qualify your parameter elements, but in rpc/literal, the
parameter elements are always unqualified.

Anne

-----Original Message-----
From: Elliot Metsger [mailto:emetsger@jhu.edu] 
Sent: Wednesday, August 18, 2004 4:00 PM
To: axis-user@ws.apache.org
Subject: Re: WSDL2Java overloading functions

Anand et. al,

Can you offer your perspective on the interoperability of rpc/lit in the 
future?  Dosen't the WS-I Basic Profile 1.0 go a ways to reducing 
opportunities for interoperability issues?

Thanks,
Elliot (a ws newbie)

Anand Natrajan wrote:
> Charles and Steve,
> 
> Mostly for my curiousity, are you using an rpc/encoded service or a
> document/literal service? My information may be wrong, but I believe the
> latter doesn't support overloaded methods. Given that the web services
> world is moving to doc/lit, having overloaded methods may be ill-advised
> for future compatibility.
> 
> Anand
> 



Re: WSDL2Java overloading functions

Posted by Elliot Metsger <em...@jhu.edu>.
Anand et. al,

Can you offer your perspective on the interoperability of rpc/lit in the 
future?  Dosen't the WS-I Basic Profile 1.0 go a ways to reducing 
opportunities for interoperability issues?

Thanks,
Elliot (a ws newbie)

Anand Natrajan wrote:
> Charles and Steve,
> 
> Mostly for my curiousity, are you using an rpc/encoded service or a
> document/literal service? My information may be wrong, but I believe the
> latter doesn't support overloaded methods. Given that the web services
> world is moving to doc/lit, having overloaded methods may be ill-advised
> for future compatibility.
> 
> Anand
> 



Re: WSDL2Java overloading functions

Posted by Anand Natrajan <an...@cs.virginia.edu>.
Charles and Steve,

Mostly for my curiousity, are you using an rpc/encoded service or a
document/literal service? My information may be wrong, but I believe the
latter doesn't support overloaded methods. Given that the web services
world is moving to doc/lit, having overloaded methods may be ill-advised
for future compatibility.

Anand

On Wed, 18 Aug 2004, Charles Roy wrote:

: Thanks Steve,
:
: Got it now on the same setup.
:
:
: Looks like the problem was in the WSDL file.
: Explicitly setting the name attribute of the operation within the
: binding and then have it correspond to the name attribute of the input
: in the corresponding portType operation fixed it.
:
: XMLSpy v5 r2 messed up my WSDL file when adding overloading methods and
: I cannot seem to specify the name attribute in the binding operations
: using it, but after fixing the WSDL file by hand it works.
:
: Thanks,
: Charles
:
: Steve Piercey wrote:
:
: >It works for me in Axis 1.1 with Tomcat 5
: >
: >Steve
: >.
: >
: >----- Original Message -----
: >From: "Charles Roy" <cr...@blueprint.org>
: >To: <ax...@ws.apache.org>
: >Sent: Wednesday, August 18, 2004 1:55 PM
: >Subject: WSDL2Java overloading functions
: >
: >
: >
: >
: >>Hi,
: >>
: >>Is it possible to overload methods and use the WSDL2Java tool to
: >>generate the stubs for the overloaded methods.
: >>
: >>Thanks,
: >>Charles
: >>
: >>
: >>
: >>
: >>
:
:
:

Re: WSDL2Java overloading functions

Posted by Charles Roy <cr...@blueprint.org>.
Thanks Steve,

Got it now on the same setup.


Looks like the problem was in the WSDL file.
Explicitly setting the name attribute of the operation within the 
binding and then have it correspond to the name attribute of the input 
in the corresponding portType operation fixed it.

XMLSpy v5 r2 messed up my WSDL file when adding overloading methods and 
I cannot seem to specify the name attribute in the binding operations 
using it, but after fixing the WSDL file by hand it works.

Thanks,
Charles

Steve Piercey wrote:

>It works for me in Axis 1.1 with Tomcat 5
>
>Steve
>.
>
>----- Original Message ----- 
>From: "Charles Roy" <cr...@blueprint.org>
>To: <ax...@ws.apache.org>
>Sent: Wednesday, August 18, 2004 1:55 PM
>Subject: WSDL2Java overloading functions
>
>
>  
>
>>Hi,
>>
>>Is it possible to overload methods and use the WSDL2Java tool to 
>>generate the stubs for the overloaded methods.
>>
>>Thanks,
>>Charles
>>
>>
>>
>>    
>>



Re: WSDL2Java overloading functions

Posted by Steve Piercey <pi...@xyenterprise.com>.
It works for me in Axis 1.1 with Tomcat 5

Steve
.

----- Original Message ----- 
From: "Charles Roy" <cr...@blueprint.org>
To: <ax...@ws.apache.org>
Sent: Wednesday, August 18, 2004 1:55 PM
Subject: WSDL2Java overloading functions


> Hi,
> 
> Is it possible to overload methods and use the WSDL2Java tool to 
> generate the stubs for the overloaded methods.
> 
> Thanks,
> Charles
> 
> 
>