Package test;
Import Javax.xml.namespace.QName;
Import Org.apache.axis.client.Call;
Import Org.apache.axis.client.Service;
Import Org.apache.axis.description.OperationDesc;
Import Org.apache.axis.description.ParameterDesc;
public class TestWS2 {
public static void Main (string[] args) {
try {
Web Service Path
String endpoint = "Http://10.1.3.142:8001/ats/GetUserFund";
String endpoint = "Http://10.1.3.113/ls/services/ATSTransWSService";
Operationdesc oper = new Operationdesc ();
Getextendsystemxmldata method of->web service for invocation
Oper.setname ("Getextendsystemxmldata");
Parameterdesc param = new Parameterdesc (New Javax.xml.namespace.QName ("", "arg0"), parameterdesc.in,
New Javax.xml.namespace.QName ("Http://www.w3.org/2001/XMLSchema", "string"), Java.lang.String.class, False, false);
Oper.addparameter (param);
Oper.setreturntype (New Javax.xml.namespace.QName ("Http://www.w3.org/2001/XMLSchema", "string"));
Oper.setreturnclass (Java.lang.String.class);
Oper.setreturnqname (New Javax.xml.namespace.QName ("", "arg0"));
Oper.setstyle (Org.apache.axis.constants.Style.RPC);
Oper.setuse (Org.apache.axis.constants.Use.ENCODED);
Service service = new service ();
Call Call Service.createcall ();
Call.settargetendpointaddress (new Java.net.URL (endpoint));
Call.setusesoapaction (TRUE);
Call.setsoapactionuri ("");
Call.setoperation (oper);
Call.setoperationname (New QName ("http://impl.getUseFund.webservice.ats.fund.hundsun.com/", " Getextendsystemxmldata "));
Request XML for document specification;
String xmlstr = "<?xml version=\" 1.0\ "encoding=\" utf-8\ "?>"
+ "<packet type=\" request\ "version=\" 1.0\ ">"
+ "<HEAD>"
+ "<REQUEST_TYPE>09</REQUEST_TYPE>"
+ "<SYSTYPE>101</SYSTYPE>"
+ "</HEAD>"
+ "<BODY>"
+ "<DETAILITEM>"
+ "<RECORDSOURCE_BATNO>2590</RECORDSOURCE_BATNO>"
+ "<ORIGIN_NOTE>5138</ORIGIN_NOTE>"
+ "</DETAILITEM>"
+ "</BODY>"
+ "</PACKET>";
Res-> return document standard receipt xml,xmlstr-> document specification request XML
string res = (string) call.invoke (new object[] {xmlstr});
System.out.println (RES);
} catch (Exception e) {
E.printstacktrace ();
}
}
}
WebService common client Code