Results 1 to 4 of 4
  1. #1
    creative.66 is offline Member
    Join Date
    Dec 2010
    Posts
    3
    Rep Power
    0

    Default java web service..

    hi evrybdy,

    my aim is
    http://api.search.live.net/search.wsdl
    using this service and making a key search of like "microsoft" then listing the return values.

    i wrote this code but it needs completing

    import org.apache.axis.client.Service;

    import com.microsoft.schemas.LiveSearch._2008._03.Search. *;


    public class WebService {
    public static void main(String[] args) {
    SearchRequest request = new SearchRequest();

    request.setAppId("******************************** *");
    request.setQuery("microsoft");
    request.setSources(new SourceType[]{SourceType.Web});


    // //Common request fields (required)
    // request.AppId = AppId;
    // request.Query = "microsoft";
    // request.Sources = new SourceType[]
    // {
    // SourceType.Web,
    // SourceType.RelatedSearch
    // };

    }
    }



    thnks...
    Last edited by creative.66; 12-07-2010 at 07:11 PM. Reason: error some rows

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    well, it looks like you are using axis. Have you found the wsdl2java tool in the axis documentation yet ? that is a command line (or Ant task) that hits a wsdl and generates a Java client stub. Once the stub is generated there should be methods with objects that model the structure of the WSDL, and you would then invoke the service by creating an instance of your generated stub object and pass the paramters to the methods in the stub.
    (that is, you wouldn't directly program with the axis service class).

  3. #3
    creative.66 is offline Member
    Join Date
    Dec 2010
    Posts
    3
    Rep Power
    0

    Default

    thnks for reply
    i understand from these i get some jars, then create client object..
    call search operations and listing the screen..

    how i can create client object, i use which class ???
    Last edited by creative.66; 12-08-2010 at 12:31 PM.

  4. #4
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    Yes, the axis2 distribution has a bunch of the jar files you need for the runtime of the generated axis client.

    Then with the axis2 distribution folder, invoke the wsdl2java command (set the bin folder onto your path or specify the path by setting AXIS_HOME environment variable)
    Probably something like

    Java Code:
    %AXIS2_HOME%\bin\WSDL2Java -uri http://api.search.live.net/search.wsdl -d adb -s -uw -o build/client
    which will use the wsdl url
    the axis data binding (adb) mechanism
    generate synchronous methods
    unwrap parametes
    and place the generated classes into the build/client folder.

    Another good reference for this is : Apache Axis2 -

    and Reference Guide to Axis2 Code Generation Parameters - Part 1 | WSO2 Oxygen Tank

    Then, in the generateFolder there will likely be a class that ends in "Stub". that is the client stub, with the methods we invoke.

Similar Threads

  1. java service
    By hannes in forum Advanced Java
    Replies: 3
    Last Post: 09-07-2010, 01:15 PM
  2. Java SE Service
    By appdevman in forum New To Java
    Replies: 2
    Last Post: 06-23-2010, 05:08 PM
  3. how to call service method inside another service
    By kirtichopra2003 in forum Web Frameworks
    Replies: 1
    Last Post: 10-24-2009, 02:19 AM
  4. How to Call a java service
    By omikeneil in forum Advanced Java
    Replies: 3
    Last Post: 10-17-2009, 03:30 AM
  5. Java Message Service
    By Java Tutorial in forum Java Tutorial
    Replies: 0
    Last Post: 06-09-2008, 09:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •