標籤:blocking tst property 資料類型 ice cli ace sse ebs
/**
* 測試 異常筆數,退費處理
* @return
*/
public static String refundHandle() {
LogUtil.info("===============調用退費介面開始=================");
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();
// 指定調用WebService的URL
// EndpointReference targetEPR = new EndpointReference("http://172.16.28.100:8089/PayAPICall.asmx");
EndpointReference targetEPR = new EndpointReference(webServiceURL);
options.setTo(targetEPR);
//options.setAction("命名空間/WS 方法名");
// options.setAction("http://www.hwsoft.com/RefundCallService");
options.setAction(actionStr);
// 指定sfexpressService方法的參數值
Object[] opAddEntryArgs = new Object[] { "test"};
// 指定sfexpressService方法傳回值的資料類型的Class對象
Class[] classes = new Class[] { String.class };
// 指定要調用的sfexpressService方法及WSDL檔案的命名空間
// QName opAddEntry = new QName("http://www.hwsoft.com/RefundCallService/","RefundCallService");
QName opAddEntry = new QName(actionStr+"/",actionName);
// 調用sfexpressService方法並輸出該方法的傳回值
Object[] str = ser.invokeBlocking(opAddEntry, opAddEntryArgs, classes);
String sss = str[0].toString();
LogUtil.info("===============調用退費介面成功================="+sss);
return sss;
} catch (AxisFault e) {
// TODO Auto-generated catch block
e.printStackTrace();
LogUtil.info("===============調用退費介面出錯================="+e.getMessage());
}
return null;
}
java使用axis2調用.net webservice介面