/**
* Test Abnormal pen number, refund processing
* @return
*/
public static String Refundhandle () {
Logutil.info ("=============== Call Refund interface starts =================");
try {
Propertiesutil proputil = new Propertiesutil ("Refundinf.properties");
Properties pros = proputil.getproperties ();
String WebServiceURL = Pros.getproperty ("WebServiceURL");
String actionstr = Pros.getproperty ("Actionstr");
String actionname = Pros.getproperty ("ActionName");
Rpcserviceclient ser = new Rpcserviceclient ();
Options options = Ser.getoptions ();
Specifies the URL to call WebService
EndpointReference Targetepr = new EndpointReference ("Http://172.16.28.100:8089/PayAPICall.asmx");
EndpointReference Targetepr = new EndpointReference (WebServiceURL);
Options.setto (TARGETEPR);
Options.setaction ("namespace/ws method name");
Options.setaction ("Http://www.hwsoft.com/RefundCallService");
Options.setaction (ACTIONSTR);
Specifying the parameter value of the Sfexpressservice method
object[] Opaddentryargs = new object[] {"Test"};
Class object specifying the data type of the Sfexpressservice method return value
Class[] classes = new class[] {string.class};
Specify the Sfexpressservice method to invoke and the namespace of the WSDL file
QName opaddentry = new QName ("http://www.hwsoft.com/RefundCallService/", "Refundcallservice");
QName opaddentry = new QName (actionstr+ "/", actionname);
Call the Sfexpressservice method and output The return value of the method
object[] str = ser.invokeblocking (Opaddentry, Opaddentryargs, classes);
String sss = str[0].tostring ();
Logutil.info ("=============== Call Refund interface succeeded =================" +SSS);
return SSS;
} catch (Axisfault e) {
TODO auto-generated Catch block
E.printstacktrace ();
Logutil.info ("=============== Call Refund Interface error =================" +e.getmessage ());
}
return null;
}
Java calls the. NET WebService interface using AXIS2