Rahul, Per the WS-I Basic Profile, a document/literal style service (whether wrapped or not wrapped) must contain at most one message part.
The first thing to understand about SOAP and WSDL is that the WSDL service interface is an abstraction of the method signature. There's no specific requirement for the two to map one-to-one. Axis tends to tie the WSDL interface pretty closely to the object interface (it makes automatic generation much more straightforward), but it doesn't have to work that way. You can create a custom provider that processes the message exactly the way you want it to. Regardless of the message style (RPC/Wrapped/Document/Message), the message is received by the Axis runtime. It looks at the message signature (the QName of the child element of the <soap:Body>) and maps it to a deployment descriptor to determine how to process the message. The deployment descriptor indicates which provider to route the message to (RPC, EJB, MSG, or a custom provider). The provider processes the message, maps the message elements to Java or DOM objects, and invokes the appropriate method. The key distinction between RPC/encoded and Doc/Literal is in the way the message is constructed. In the first case, the message is constructed according to the SOAP encoding data model (which is under-specified, and therefore a source of interoperability problems). In the second case, the message is constructed according to the schema that defines your message. The routing of messages is orthogonal to the method used to construct the message. Anne -----Original Message----- From: Rahul Jain [mailto:[EMAIL PROTECTED] Sent: Monday, June 14, 2004 2:28 PM To: [EMAIL PROTECTED] Subject: RE: Exposing an EJB as a doc-literal web service 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/