This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

webservices api  RSS feed

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai
can any give me webservice api for writing the client program.
please
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When writing a WS client one generally starts with the WSDL description of the WS in question. Do you have that? If you do, then the WS toolkit you decided to use most likely has a tool to generate client code. It might be called wsdl2java or some such.
 
ramchander yshetti
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks ulf,

here in this program we are creating the object to the Call class
where the call class is available.

public class MySoapClient
{
public static void main(String[] args){
Call call = new Call();
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setTargetObjectURI ("urn:NextMessage");
call.setMethodName ("getMessage");
Vector params = new Vector();
Parameter userIDParam = new Parameter(
"UserID", String.class, "JDoe", Constants.NS_URI_SOAP_ENC);
params.addElement(userIDParam);
Parameter passwordParam = new Parameter(
"Password", String.class, "0JDOE0", Constants.NS_URI_SOAP_ENC);
params.addElement(passwordParam);
call.setParams(params);
Response resp = null;
URL url = new URL ("http://www.messages.com/soap/servlet/rpcrouter");
resp = call.invoke (url, "urn:NextMessage"); // url, soapActionURI
// soapActionURI is URN for Apache, "" for most other servers
if (resp.generatedFault()) {
Fault fault=resp.getFault();
System.out.println(" Fault code: " + fault.getFaultCode());
System.out.println(" Fault string: " + fault.getFaultString());
} else {
Parameter result=resp.getReturnValue();
Object o = result.getValue();
System.out.println("Result: " + o);
}
}
}
 
We noticed he had no friends. So we gave him this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!