[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

SoapRpcMethodAttribute and SoapDocumentMethodAttribute

Paul Finn

12/31/2002 1:47:00 PM

what is the difference in setting the message style of the web service
methods to Rpc or Document style ?

will there be a diff in the implementation or the calling of methods by
those two diff styles?





*** Sent via Developersdex http://www.develop... ***
Don't just participate in USENET...get rewarded for it!
3 Answers

Paul Finn

12/31/2002 4:31:00 PM

0

Hi,
I have a few doubts regarding RPC and messaging and the
use/need for
Document style and RPC style encoding of SOAP messages. I
have searched on
many websites but I haven't been able to find a convincing
answer.
Is it right to say that when invoking a webservice, a SOAP
message is
serving the purpose of a remote procedure call.

1. I am not able to understand why we require two styles(
Document and RPC
style) for encoding SOAP messages.
2. When is the criteria for using either of the two styles
i.e When should
one use Document style and when the RPC style.
3. Is is necessary that Document style be used for
Messaging communication
and RPC style for remote precedure invocation?
4. What is the main difference between Messaging and RPC?




*** Sent via Developersdex http://www.develop... ***
Don't just participate in USENET...get rewarded for it!

Doug&Cindy

1/2/2003 3:53:00 PM

0

Trace the input and output of a webservice to see the different styles...the
basic need that I know of is interop between webservice
providors...specificly if you're a java site using the Apache toolkit your
method arguments/response MUST have an xsi:type attribute on
them....otherwise the toolkit does not know how to deserialize the data....I
believe the RPC method always includes the type attribute...The SoapDocument
method you can further define by using the SoapBindingUse attribute...

ex.) SoapDocumentMethod(Use:=SoapBindingUse.Encoded,
ParameterStyle:=SoapParameterStyle.Default)
will make a Method called Add look like this..
<types:Add>
<a xsi:type="xsd:int">3</a>
<b xsi:type="xsd:int">4</b>
</types:Add>

Compared to this... SoapDocumentMethod(Use:=SoapBindingUse.Literal,
ParameterStyle:=SoapParameterStyle.Default)
<Add xmlns="http://tempuri.org/...
<a>3</a>
<b>4</b>
</Add>

Compared to SoapRPC...
<tns:Add>
<a xsi:type="xsd:int">3</a>
<b xsi:type="xsd:int">4</b>
</tns:Add>

hth
Doug


"Paul Finn" <digital_function@hotmail.com> wrote in message
news:eTpbTrMsCHA.2060@TK2MSFTNGP12...
> what is the difference in setting the message style of the web service
> methods to Rpc or Document style ?
>
> will there be a diff in the implementation or the calling of methods by
> those two diff styles?
>
>
>
>
>
> *** Sent via Developersdex http://www.develop... ***
> Don't just participate in USENET...get rewarded for it!


wcstombs

1/7/2003 6:11:00 AM

0

Normally RPC style is used when there are only very
simple datatyes which need to passed as parameters to
WebMethods. e,g.

[WebMethod]
public string GetCurrentTemperature (string zip)

Like u can see above, RPC is only for such simple
situations.

Incase u want to pass more complex data types, or share
XML messages itself, then you have to use DOCUMENT style.

Personally I would ALWAYS use document style, since we
are talking abt SOAP messages, and they are XML messages
themselves.

Try using the trace utility provided by SOAP toolkit to
see how the structure of the SOAP messages differ in the
two styles.

Hope this helps :-)