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: Query
Date Tue, 12 Aug 2003 12:00:46 GMT
Ashish,

I hope you don't mind, but I'm sending this response to the Axis community,
because I'm sure others will appreciate it.

You asked:
> Can more than two operations in WSDL refer to the same message? if
> yes then is there a way to map the message back to the operation? How
> we can map the message back to the operation?Will the behaviour
> differ in case rpc and document styles?

The WSDL specification explicitly allows the reuse of messages, so, yes, two
operations may refer to the same message. But I would recommend that you do
so only when using the RPC style. A SOAP server is supposed to dispatch
requests based on the Qname of the child element of the <soapenv:body>. When
you're using RPC, the RPC system automatically generates a unique Qname for
each operation -- the child element of the <soapenv:body> is the operation
name. When you're using Document style, the Qname of the child element of
the <soapenv:body> is the element named in the message <part> definition. So
for example, for any operation that uses the following message definition as
its input, the child element of <soapenv:body> will be <tns:foobar>

<message name="foo">
   <part name=body element="tns:foobar" />
</message>

So, if you have two operations that use the same message as input, your SOAP
server can't distinguish between the two messages based on the Qname. In
this case you have to use some other mechanism to distinguish the messages,
such as the HTTP SOAPAction header. This mechanism works in SOAP 1.1, but
SOAPAction will be an optional feature in SOAP 1.2, so I suggest that you
not grow dependent on it.

Note that you would have the same problem if you use the same element
definition in two messages:

<message name="foo">
   <part name=body element="tns:foobar" />
</message>

<message name="bar">
   <part name=body element="tns:foobar" />
</message>

In this situation, if you use message "foo" in one operation and message
"bar" in a second operation, both opertions will produce a signature of
<tns:foobar>.

Therefore, I recommend that you define separate elements for each message
definition, although both elements may use the same type:

<element name="foo" type="tns:foobar"/>
<element name="bar" type="tns:foobar"/>
<complexType name="foobar>
   !--type definition
</complexType>

<message name="foo">
   <part name=body element="tns:foo" />
</message>

<message name="bar">
   <part name=body element="tns:bar" />
</message>

Best regards,
Anne

----- Original Message -----
From: "sood_303" <asood@ipolicynet.com>
To: <anne@manes.net>
Sent: Tuesday, August 12, 2003 5:01 AM
Subject: Query


> Hi,
>
> I read your repsonse to a question asked regarding WSDL. Well, the
> response was excellent and explained all the details of WSDL
> maginficently. It ecouraged me mail  a question to you in
> anticipation of similar response.
>
> I am also a newbie in this field.
> I am working on software that has to decode a SOAP message and map it
> to an operation. Assuming I have access to the WSDL file.
> Can more than two operations in WSDL refer to the same message? if
> yes then is there a way to map the message back to the operation? How
> we can map the message back to the operation?Will the behaviour
> differ in case rpc and document styles?
>
> Thanks
> Ashish
>


Mime
View raw message