Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

Consuming XFire Webservice

Thread view: 
Ali1980 - 05 Jul 2006 14:01 GMT
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
Tomek - 05 Jul 2006 15:25 GMT
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):
> Hi everyone,,
>
[quoted text clipped - 4 lines]
> Regards
> Ali
Ali1980 - 05 Jul 2006 17:37 GMT
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());

    }

> Hi,
> Assuming you are using java on client side:
[quoted text clipped - 20 lines]
> > Regards
> > Ali
Tomek - 06 Jul 2006 13:38 GMT
> 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):
> 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
[quoted text clipped - 39 lines]
> > > Regards
> > > Ali


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.