Feb 20 2009

Eclipse plug-in as a web service client

Published by Radoslaw Urbas at 10:16 pm under Eclipse,IT,Java

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/

4 responses so far

4 Responses to “Eclipse plug-in as a web service client”

  1. jacekon 21 Feb 2009 at 8:46 am

    why I haven’t seen you earlier on Eclipse Planet!? Great to hear more from Poland :-)

  2. Tom Schindlon 21 Feb 2009 at 1:36 pm

    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.

  3. Craigon 19 Mar 2009 at 4:50 am

    Great post Radoslaw, I’m curious will the socket connections made route through the proxy settings setup in Eclipse?

  4. nanion 22 Jun 2009 at 6:52 pm

    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,,,

Trackback URI | Comments RSS

Leave a Reply