標籤:method name sdl factory get catch web ctf parameter
調用程式中的webservice
public void manualExecuteCollect(String searchID, String tableName) { Properties properties = PropertiesUtils.getProperties("config.properties"); String serviceUrl = properties.getProperty("webservice.url"); ServiceClient sender = null; String wsURL = serviceUrl + "/webServices/nhfpcHandCollectionWs?wsdl"; try { EndpointReference endpoint = new EndpointReference(wsURL); Options options = new Options(); options.setTo(endpoint); options.setProperty(HTTPConstants.CHUNKED, "false");//設定不受限制. sender = new ServiceClient(); sender.setOptions(options); OMFactory fac = OMAbstractFactory.getOMFactory(); OMNamespace omNs = fac.createOMNamespace("http://webservice.nhfpc.acquisition.goodwill.com/", ""); OMElement method = fac.createOMElement("nhfpcMedicalServiceHandCollection", omNs); OMElement tableNameParamater = fac.createOMElement("tableName", omNs);// 設定入參名稱 tableNameParamater.setText(tableName);// 設定入參值 method.addChild(tableNameParamater); OMElement searchIDParameter = fac.createOMElement("pid", omNs);// 設定入參名稱 searchIDParameter.setText(searchID);// 設定入參值 method.addChild(searchIDParameter); method.build(); sender.sendReceive(method); // OMElement elementReturn = response.getFirstElement(); // String result = elementReturn.getText(); // System.out.println(result); } catch (Exception e) { logger.error("調用手動執行webservice方法出錯。" + e.getMessage(), e); throw new ApplicationException("手動執行資料擷取出錯,請聯絡管理員。"); } }
調用程式中的webservice