java使用axis2調用.net webservice介面

來源:互聯網
上載者:User

標籤: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介面

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.