axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ramon Turnes <ramon.turnes-pe...@hermes.si>
Subject RE: Document style service with two methods
Date Thu, 04 Apr 2002 06:52:44 GMT

Hi Stan,

I did not tried to call setOperationName() because I create the whole
body of the SOAP envelope and I think that call.setOperationName()
won't help in this case. However, I will give it a try. Nice to hear that
it worked for you. Regards.

Ramon.

> -----Original Message-----
> From: Stan Jordan [mailto:skjordan@worldnet.att.net]
> Sent: Thursday, April 04, 2002 1:58 AM
> To: axis-user@xml.apache.org
> Subject: Re: Document style service with two methods
> 
> 
> Ramon...
> Yup, I got it to work with 2 methods.  I am most grateful for 
> your help.
> Thanks!
> Stan
> 
> ----- Original Message -----
> From: "Stan Jordan" <skjordan@worldnet.att.net>
> To: <axis-user@xml.apache.org>
> Sent: Wednesday, April 03, 2002 8:06 AM
> Subject: Re: Document style service with two methods
> 
> 
> > Hi Ramon...
> > Thanks much for the info.  I was thinking of putting this 
> in the client:
> >         call.setOperationName("methodA");
> > But it sounds like you did not do this.  Right?
> > Thanks again.
> > Stan
> >
> > ----- Original Message -----
> > From: "Ramon Turnes" <ramon.turnes-perez@hermes.si>
> > To: <axis-user@xml.apache.org>
> > Sent: Wednesday, April 03, 2002 6:06 AM
> > Subject: RE: Document style service with two methods
> >
> >
> > >
> > > Hi to both,
> > >
> > > well, actually I had figured out how to do it by taking a look at
> > > the source code.  Let's suppose this is my message service with
> > > two methods:
> > >
> > > public class MyService {
> > >   Document methodA(Document xml) {
> > >     ...
> > >   }
> > >
> > >   Document methodB(Document xml) {
> > >     ...
> > >   }
> > > }
> > >
> > > 1. In the WSDD deployment document you must put this:
> > >
> > > <service name="MessageService" provider="java:MSG" >
> > >   <parameter name="className" value="MessageService"/>
> > >   <parameter name="allowedMethods" value="*"/>
> > > </service>
> > >
> > > where is important that you put "*" to list your methods.
> > > Explicit listing of both methods does not work (I believe
> > > is a bug in Axis).
> > >
> > > 2. Your client application must send this within the
> > > SOAP-ENV:Body element:
> > >
> > > <methodA>
> > >   <data>
> > >   </data>
> > > </methodA>
> > >
> > > or
> > >
> > > <methodB>
> > >   <data>
> > >   </data>
> > > </methodB>
> > >
> > >
> > > You must notice that if you only had one method you
> > > would send this:
> > >
> > > <data>
> > > </data>
> > >
> > > Axis Message provider takes a look at the root tags within
> > > your document to figure out which method to be called. Whether
> > > this is the right way to do it is another issue.
> > >
> > > Ramon.
> > >
> > > > -----Original Message-----
> > > > From: Stan Jordan [mailto:skjordan@worldnet.att.net]
> > > > Sent: Wednesday, April 03, 2002 1:07 AM
> > > > To: axis-user@xml.apache.org
> > > > Subject: Re: Document style service with two methods
> > > >
> > > >
> > > > Ramon & Steve...
> > > > This is not quite the answer you want, but may send you 
> in the right
> > > > direction.  Take a look at this service:
> > > >
> > > > http://samples.gotdotnet.com/quickstart/aspplus/samples/servic
> > > > es/MathService
> > > > /VB/MathService.asmx
> > > > The service is style="document" and provides four methods:
> > > >     float Add(float a, float b);
> > > >     float Subtract(float a, float b);
> > > >     float Multiply(float a, float b);
> > > >     float Divide(float a, float b);
> > > > Do this:
> > > > Create wsdl file with your browser, create stubs, and compile
> > > > the stubs.
> > > > Now compile & execute the client shown below.  Works fine!
> > > > By examining the stubs, maybe you will find what you 
> are looking for.
> > > > Cheers.
> > > > Stan
> > > > --------------------------------
> > > > //This is client for a service with style="document"
> > > > import org.tempuri.MathServiceLocator;
> > > > import org.tempuri.MathServiceSoap;
> > > >
> > > > public class Client {
> > > >   public static void main(String [] args) throws Exception {
> > > >
> > > >     MathServiceLocator service = new MathServiceLocator();
> > > >     MathServiceSoap port = service.getMathServiceSoap();
> > > >
> > > >  System.out.println("     add= " + port.add(1.1F, 2.5F));
> > > >  System.out.println("multiply= " + port.multiply(1.1F, 2.0F));
> > > >  System.out.println("  divide= " + port.divide(10.0F, 3.0F));
> > > >   }
> > > > }
> > > >
> > > > --------------------------------
> > > > ----- Original Message -----
> > > > From: "Steven Gollery" <sgollery@cadrc.calpoly.edu>
> > > > To: <axis-user@xml.apache.org>
> > > > Sent: Tuesday, April 02, 2002 1:34 PM
> > > > Subject: RE: Document style service with two methods
> > > >
> > > >
> > > > > Ramon,
> > > > >
> > > > > I have the same problem -- I've been hoping that someone
> > > > with more Axis
> > > > > experience than I have would jump in and either tell us how
> > > > to do this
> > > > > or confirm that it can't be done for some reason.
> > > > >
> > > > > The only solution I've been able to come up with is 
> one that you've
> > > > > probably already considered (and which I think is the same
> > > > way that the
> > > > > AdminClient works): have one service method, but put 
> the real method
> > > > > name in the document itself (probably in the root tag).
> > > > Then the method
> > > > > implementation checks to see what operation the client
> > > > wants and calls
> > > > > that method itself.
> > > > >
> > > > > But this seems unsatisfactory to me. Hopefully the Axis
> > > > people can come
> > > > > up with a better approach.
> > > > >
> > > > > Steve Gollery
> > > > >
> > > > > Ramon Turnes wrote:
> > > > >
> > > > > >Hi,
> > > > > >
> > > > > >I would like to have a service using Document style with two
> > > > > >methods but it seems that this is not possible because the
> > > > > >message dispatcher for Document style services checks for
> > > > > >a method with the following signature:
> > > > > >
> > > > > >
> > > > > >  Document MyMethod(MessageContext mc, Document xml) {
> > > > >  > .....
> > > > >   >}
> > > > > >
> > > > > >and the method name is not taken into consideration for
> > > > > >deciding which method to call. But what if I want to have
> > > > > >two methods in my service, let's say a Registration method
> > > > > >and a Ordering method? Should I provide then two endpoints
> > > > > >for each of the methods (I saw an example in WSTK 
> that does it).
> > > > > >Can I do this with Document style services or I need 
> to use RPC?
> > > > > >
> > > > > >Thanks.
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> >
> 
> 

Mime
View raw message