Feb 20 2009

Eclipse plug-in as a web service client

Published by 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();

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

8 responses so far

8 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

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

  5. Hugo Quakenbushon 13 Jun 2011 at 6:34 pm

    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.

  6. Selvion 21 Sep 2011 at 1:11 pm

    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…

  7. pkon 14 Mar 2014 at 2:18 pm

    where to create TransportSearviceSoap object? help

  8. pkon 14 Mar 2014 at 2:21 pm

    Please suggest where to write

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

    in which folder TransportServiceSoap gets created

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.