• Post Reply Bookmark Topic Watch Topic
  • New Topic

webservices api  RSS feed

 
ramchander yshetti
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
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • 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);
}
}
}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!