Hi,

---
call.setOperationName("someMethod");
String ret = (String) call.invoke( new Object[] { new Integer(6) } );
---

First you set the operation name, that is, the service's method you want to call then you excute the method (call.invoke()). The parameters for the service are passed as an array, so basically that's a rather complicated way of calling:

service.someMethod(new Integer(6));

The service in turn returns a String, which you have to cast, since invoke() only returns an java.lang.Object.

I'm not sure what you mean by "carry on". At this point the client has called the service and a result was returned so basically the transaction is finished. What else do you want to do?

Reagrds,
Tom


Plorks mail wrote:

Hi

Can you explain the lline


String txt = (String) call.invoke(new Object[] { new Integer(6) });


How o carry on the code after this line

Sorry for my newbiee questions



From: Tom Ziemer <[EMAIL PROTECTED]>
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: Re: invoke methods wsdl file
Date: Tue, 03 May 2005 14:27:07 +0200

Hi there!

You could let ANT (using the axis-tasks) generate the necessary stub files. In my opinion that is a much cleaner approach. Then you simply call the service as if it were a local object:

// the locator is generated by axis/ant...
someLocator locator = new someLocator();
// ...the service object as well
someService service = null;
try
{
  // get a reference
  someService = somelocator.getSomeService();
  // call the service
  String msg = someService.someMethod();
  ...
}
...

If you want to do it the other way:

String endpoint = "http://xxx/someService";;
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
// define operation (method)
call.setOperationName("methodToCall");
// call the service
String txt = (String) call.invoke(new Object[] { new Integer(6) });
...

As I said - I prefer the former way. Hope this helps you to get started.

Regards,
Tom

Plorks mail wrote:


Hello

I've got to develop a web service client, but don't know where to start

I have the external wsdl file which exposes the methods i wish to invoke.

Is it something like this

public static void main(String args[])
{
URL url = new URL("http://thirdpartycallservice/third_party_calling_service.wsdl";);
Service service = new Service();
Call call = (Call)service.createCall();
.
.
.
.
.
.
}


I don't know the next code to continue

Any help much appreciated

_________________________________________________________________
Be the first to hear what's new at MSN - sign up to our free newsletters! http://www.msn.co.uk/newsletters



_________________________________________________________________
Want to block unwanted pop-ups? Download the free MSN Toolbar now! http://toolbar.msn.co.uk/


Reply via email to