aspose file tools*
The moose likes Web Services and the fly likes web service client in j2se Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "web service client in j2se" Watch "web service client in j2se" New topic
Author

web service client in j2se

mani senthil
Greenhorn

Joined: Jan 18, 2007
Posts: 17
Here is the code of webservice call in j2me using ksoap. which is working good.
public String getCount() throws Exception {
StringBuffer sb = new StringBuffer();
SoapObject client = new SoapObject("http://xxxxxxx/cqforms/", "GetCount");
client.addProperty("Mode", criteria.by);
client.addProperty("SearchString", txtSearch.getText());
HttpTransport ht = new HttpTransport("http://xxxxxxxxx/cqforms/Service1.asmx", "GetCount");
sb.append("" + ht.call(client));
return sb.toString();
}
how do i call the same webservice in swing application. i am using netbeans 6.9 IDE.
Jason Cone
Greenhorn

Joined: Jul 21, 2004
Posts: 25
Is there any reason you don't want to use the J2SE version of kSOAP? (I haven't used kSOAP, but there's a J2SE jar on the sourceforge files page.)

mani senthil
Greenhorn

Joined: Jan 18, 2007
Posts: 17
I got that, but HttpTransport class is not available in that jar. is there any alternative to that class
Jason Cone
Greenhorn

Joined: Jul 21, 2004
Posts: 25
mani senthil wrote:I got that, but HttpTransport class is not available in that jar. is there any alternative to that class

There's the HttpTransportSE class.
mani senthil
Greenhorn

Joined: Jan 18, 2007
Posts: 17
thank you very much Jason Cone. It is working now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: web service client in j2se