iframe引用頁面在父類頁面呼叫函式只重新整理子頁面方法
阿新 • • 發佈:2018-12-18
###apache的axis需要的jar
<dependency> <groupId>org.apache.axis</groupId> <artifactId>axis</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>org.apache.axis</groupId> <artifactId>axis-jaxrpc</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>axis</groupId> <artifactId>axis-wsdl4j</artifactId> <version>1.5.1</version> </dependency>
###接收發布的WebServcie
public String getRunNameTree() throws ServiceException, RemoteException { Ota3Util util = new Ota3Util(); String addess = util.getDepartmentAddress(); String uri = util.getDepartmentURI(); String getStaffList = util.getGetStaffList(); Service service = new Service(); Call call = (Call) service.createCall(); // webservice 訪問地址 call.setTargetEndpointAddress(addess); call.setSOAPActionURI(""); call.setUseSOAPAction(true); // webservice 名稱空間和方法名 call.setOperationName(new QName(uri,getStaffList)); call.setReturnType(XMLType.XSD_STRING); // webservice引數的名稱 call.addParameter("param", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN); JSONObject json = new JSONObject(); json.put("depId", "2c9080f2491297ea0149129956bf0005"); // 呼叫webservice 獲取返回值,json.toString為傳遞引數 String result = (String) call.invoke(new Object[] { json.toString()}); return result; }
###釋出準備中