The following article is short and to the point:

Which style of WSDL should I use?
RPC/encoded, RPC/literal, document/literal? Which one?

By: Russell Butek
Software Engineer, IBM
31 October 2003

http://www-106.ibm.com/developerworks/webservices/library/ws-whichwsdl/


Raul Flores



-----Original Message-----
From: Rahul Jain [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 14, 2004 1:35 PM
To: [EMAIL PROTECTED]
Subject: RE: Exposing an EJB as a doc-literal web service


Hi,

Sorry...here is the attachd WSDL for the non-wrapped doc-literal
service.

Rahul.


>From: "Rahul Jain" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: RE: Exposing an EJB as a doc-literal web service
>Date: Mon, 14 Jun 2004 11:28:16 -0700
>
>Hi Anne,
>
>Attached is the WSDL file.
>Your hunch was right. And as soon as I changed the service to a
>wrapped-literal, it started working. I don't know why the Java2WSDL
tool 
>would generate the wrong WSDL when I used the flags ( --style DOCUMENT 
>--use LITERAL). I then changed the style to WRAPPED and it was fine. So

>does this mean that doc-literal services should always take one param
and 
>not more?
>
>Also can you clarify something: According to me, say there is a class 
>with
>a method signature (from my case)
>public String loadXMLData(String user, String xmlData)
>
>and if one wants to expose this as a web service, then one can/should
>either expose this as a RPC-encoded service or as a doc-literal web
service 
>(wrapped or non-wrapped). The difference between the three being how
the 
>SOAP request and response message looks. Now what I don't get is this:
For 
>the RPC-encoded the method will be invoked like a RPC call, while 
>doc-literal is supposed to act in a different manner and I don't see
how. 
>The method still gets invoked for a doc-literal service and the same
data 
>gets passed in and worked upon. I don't see a difference in how
RPC-encoded 
>and doc-literal is different in the example above. Obviously, I am
missing 
>something here and I would really appreciate if you can clarify this.
>
>Thanks.
>
>Rahul.
>
>
>>From: "Anne Thomas Manes" <[EMAIL PROTECTED]>
>>Reply-To: [EMAIL PROTECTED]
>>To: <[EMAIL PROTECTED]>
>>Subject: RE: Exposing an EJB as a doc-literal web service
>>Date: Thu, 10 Jun 2004 10:29:26 -0400
>>
>>Can you send us your WSDL?
>>
>>My first hunch is that you aren't using a wrapper element for your two

>>parameters. A doc/literal message must contain only one child element 
>>in the <soap:Body>. Axis will process only the first element and 
>>ignore any subsequent elements. That first child element should be a 
>>wrapper element that contains all your parameters.
>>
>>Anne
>>
>>-----Original Message-----
>>From: Rahul Jain [mailto:[EMAIL PROTECTED]
>>Sent: Tuesday, June 08, 2004 8:20 PM
>>To: [EMAIL PROTECTED]
>>Subject: RE: Exposing an EJB as a doc-literal web service
>>
>>Hi,
>>
>>Thanks for the help, Wei.
>>
>>I did what you suggested and it worked, but partially.
>>
>>The issue is there is a method called loadXMLData(String param1, 
>>String
>>param2) on the EJB. I deployed the EJB as a web service exposing this
>>method. I then wrote a client to invoke (actually used the Junit test
case
>>generated by WSDL2Java) to test the service. What happens is the EJB
on 
>>the
>>server only get the value for param1, but param2 is null. On the
client 
>>side
>>
>>I checked that the Axis generated <ServiceName>SoapBindingStub which 
>>actually invoked the call using org.apache.axis.client.Call instance
>>invoke(Object[]) method, passes in the proper values to the invoke()
>>method.
>>
>>But somehow on the server (EJB) only the first param (param1) is 
>>obtained fine...param2 is somehow null. Also checked the EJB code and 
>>its is not doing anything funky. It just receives the param2 as null 
>>and hence throws an exception.
>>
>>Thanks.
>>
>>Rahul.
>>
>>
>>
>> >From: Wei Hsu <[EMAIL PROTECTED]>
>> >Reply-To: [EMAIL PROTECTED]
>> >To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>> >Subject: RE: Exposing an EJB as a doc-literal web service
>> >Date: Mon, 7 Jun 2004 15:53:45 -0700
>> >
>> >Actually, the build-in Axis EJB Provider can expose the EJB as a 
>> >doc-literal web service.  In the simplest case, all you have to do 
>> >is change one
>>line
>> >in
>> >your deploy.wsdd:
>> >
>> >From
>> >
>> ><service name="MyService" provider="java:EJB">
>> >
>> >to
>> >
>> ><service name="MyService" provider="java:EJB" style="wrapped" 
>> >use="literal">
>> >
>> >If you want to use straight up doc-lit and not wrapped style, just 
>> >set style="document" instead.
>> >
>> >-Wei
>> >
>> >-----Original Message-----
>> >From: Rahul Jain [mailto:[EMAIL PROTECTED]
>> >Sent: Monday, June 07, 2004 10:12 AM
>> >To: [EMAIL PROTECTED]
>> >Subject: Exposing an EJB as a doc-literal web service
>> >
>> >Hi,
>> >
>> >Can somebody plz gudie me how I would expose an EJB as a doc-literal

>> >web service? The build-in Axis EJB Provider exposes it as a RPC 
>> >service
>>only.
>> >
>> >Thanks.
>> >
>> >Rahul.
>> >
>> >_________________________________________________________________
>> >Looking to buy a house? Get informed with the Home Buying Guide from

>> >MSN House & Home. http://coldwellbanker.msn.com/
>>
>>_________________________________________________________________
>>Getting married? Find great tips, tools and the latest trends at MSN 
>>Life Events. http://lifeevents.msn.com/category.aspx?cid=married
>>
>
>_________________________________________________________________
>MSN 9 Dial-up Internet Access fights spam and pop-ups - now 3 months 
>FREE!
>http://join.msn.click-url.com/go/onm00200361ave/direct/01/
>

_________________________________________________________________
Stop worrying about overloading your inbox - get MSN Hotmail Extra
Storage! 
http://join.msn.click-url.com/go/onm00200362ave/direct/01/

Reply via email to