Eclipse plug-in as a web service client

Recently I was playing around consuming web service inside Eclipse plug-in. Making simple web service call maybe a bit tricky at the beginning. I’m going to provide quick start instruction here,

Required software:

  • Eclipse for RCP/Plug-in Developer
  • JEE Standard Tools & Axis
    JEE Standard Tools

Configuration steps:

  • Define new JEE service in a workspace
    Defining JEE server
  • Create new plug-in project
    Creating new plug-in project
  • Add following dependencies to the plug-in:
    • org.apache.commons.logging
    • javax.wsdl
    • javax.xml.rpc
    • javax.xml.soap
    • org.apache.commons.discovery
    • org.apache.axis

    Web service client dependencies

  • Generate web service client code
    Generating web service client code

    Generating web service client code based on WSDL

Consume web service:

Using web service in side a plug-in is no different than anyone else. Sample of invoking web service method:

TransportServiceSoap service = new TransportServiceLocator().getTransportServiceSoap();
service.getCities();

Instruction presented above is based on Eclipse 3.4.1 and uses sample web service from http://www.urbanlife.pl/

8 comments

  1. It’s sad that this integration is done with Axis which has many many problems IMHO starting from performance problems to memory leaks (leak is the wrong term it’s a black hole) that you can’t transfer.

    Like

  2. Hello,
    thanks for the info provided can you let me know how to create a web service client in RCP application using web service runtime: Apache axis2 rather than axis..

    Eagerly waiting for reply,,,

    Like

  3. Thanks for your article. What I want to point out is that when looking for a good on the web electronics store, look for a site with entire information on important factors such as the security statement, basic safety details, payment methods, along with other terms and also policies. Continually take time to browse the help along with FAQ areas to get a far better idea of what sort of shop will work, what they are capable of doing for you, and the way you can maximize the features.

    Like

  4. I read your article and it is helpful.

    But I’m facing a problem related to web service access on lotus notes. I’m developing a project that uses a web service call to get share point document library in lotus notes. All the web service access methods are implemented on net beans and created a jar files, I imported that jar files in eclipse and configured the project to run as lotus notes application. But web service access is possible only when running as a standalone application, When we run as lotus notes configuration, the “Server Send Http code 400: bad request” error getting. Please help me to solve this issue, because we are trying to solve this issue for last 2 weeks.

    Thanks in advance…

    Like

  5. Please suggest where to write

    TransportServiceSoap service = new TransportServiceLocator().getTransportServiceSoap();
    service.getCities();

    in which folder TransportServiceSoap gets created

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s