Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web service client in j2se

 
mani senthil
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got that, but HttpTransport class is not available in that jar. is there any alternative to that class
 
Jason Cone
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much Jason Cone. It is working now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic