It is VERY unfortunate that the interface needs information from both the
portType AND the binding.  This is a topic of discussion for WSDL version
2.

JAX-RPC says (section 4.3.3):  "The name of the Java interface is mapped
from the name attribute of the wsdl:portType element. ... If the mapping to
a service definition interface uses elements of the wsdl:binding ..., then
the name of the service definition interface is mapped from the name of the
wsdel:binding element."

Note the name of the spec.  It contains the string "RPC".  So this spec,
and WSDL2Java, assumes that the interface generated from the portType is an
RPC interface.  If information from the binding tells us otherwise (in
other words, we use elements of the wsdl:binding), then the name of the
interface is derived instead from the binding.

Note that we could have one portType - pt - and two bindings:  bRPC and
bDoc.  Since doc/lit changes what the interface looks like, we cannot use a
single interface for both of these bindings, so we end up with 2 interfaces
- pt and another named bDoc - and two stubs - bRPCStub (which implements
pt) and bDocStub (which implements bDoc).

Ugly, isn't it?  But you can see why it's necessary.  Since doc/lit changes
what the interface looks like, and we could have more than one binding
refering to a single portType, we have to create more than one interface
and each interface must have a unique name.

Russell Butek
[EMAIL PROTECTED]


Thomas Sandholm <[EMAIL PROTECTED]> on 03/13/2002 05:24:30 PM

Please respond to [EMAIL PROTECTED]

To:    [EMAIL PROTECTED]
cc:
Subject:    WSDL2Java doc/literal port type interface



I have noticed that the newest code from cvs generates a port type
interface using the wsdl:portType name when rpc/encoded is used, but if
doc/literal is used the wsdl:binding name is used. Is there any particular
design rationale behind this? I think it seems to break the idea of not
exposing the fact that doc/literal is used to the client or to the service
implementer. Besides that it seems like this interface should not have any
knowledge about the binding, so it seems strange that it uses the name of
the binding in its own name in the doc/literal approach.
Any thoughts about this?

/Thomas



Reply via email to