Consuming XFire Webservice

A

Ali1980

Hi everyone,,

I am not too sure how to consume an xfire webservice, the webservice I
want to consume has world() method which I want to use to disply in the
client side.. any example?

Regards
Ali
 
T

Tomek

Hi,
Assuming you are using java on client side:
1. You can generate client code from service wsdl using wsgen tool
or
2. If you have java interface of the service you can use it with proxy
object to execute service ( without any code generation).

Samples for these scenarios are in example folder inside XFire
distribution:
goip-client for scenarion 1
book for scenario 2

When you have client code you just call world() method on client
object.

Ali1980 napisal(a):
 
A

Ali1980

Hi.. and thanks for your reply.. I used the eclipse XFire plugin to
generate all the classes for me, however when I try to access the ws
using these classes i only get "passed1" displyed,
so it does failt at the creation of the service model.

Any other suggestions!?


public void webservices()throws MalformedURLException
{
System.out.println("passed1");
Service serviceModel = new
ObjectServiceFactory().create(LocationServiceImpl.class);
System.out.println("passed2");
LocationServiceImpl service = (LocationServiceImpl) new
XFireProxyFactory().create(serviceModel, "URL of the WSDL");
System.out.println(service.world());



}
 
T

Tomek

XFireProxyFactory().create(serviceModel, "URL of the WSDL");
As i remeber , the second parameter is a url to service, not to wsdl.
So it should look like :
proxyFactory.create(serviceModel, "http://localhost:8080/MyService");

You could also add try/catch and see i any error occured.

Ali1980 napisal(a):
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top