Results 1 to 4 of 4
Thread: java web service..
- 12-07-2010, 07:08 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 3
- Rep Power
- 0
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
- 12-08-2010, 03:21 AM #2
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).
- 12-08-2010, 11:58 AM #3
Member
- Join Date
- Dec 2010
- Posts
- 3
- Rep Power
- 0
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.
- 12-09-2010, 03:57 AM #4
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
which will use the wsdl urlJava Code:%AXIS2_HOME%\bin\WSDL2Java -uri http://api.search.live.net/search.wsdl -d adb -s -uw -o build/client
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
-
java service
By hannes in forum Advanced JavaReplies: 3Last Post: 09-07-2010, 01:15 PM -
Java SE Service
By appdevman in forum New To JavaReplies: 2Last Post: 06-23-2010, 05:08 PM -
how to call service method inside another service
By kirtichopra2003 in forum Web FrameworksReplies: 1Last Post: 10-24-2009, 02:19 AM -
How to Call a java service
By omikeneil in forum Advanced JavaReplies: 3Last Post: 10-17-2009, 03:30 AM -
Java Message Service
By Java Tutorial in forum Java TutorialReplies: 0Last Post: 06-09-2008, 09:57 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks