⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clientadd.java

📁 globus toolkit Math例子
💻 JAVA
字号:
package org.globus.examples.clients.MathService_instance;import java.io.FileInputStream;import org.apache.axis.message.addressing.Address;import org.apache.axis.message.addressing.EndpointReferenceType;import org.globus.examples.stubs.MathService_instance.GetValueRP;import org.globus.examples.stubs.MathService_instance.MathPortType;import org.globus.examples.stubs.MathService_instance.service.MathServiceAddressingLocator;import org.globus.wsrf.encoding.ObjectDeserializer;import org.xml.sax.InputSource;public class ClientAdd {	public static void main(String[] args) {		MathServiceAddressingLocator instanceLocator = new MathServiceAddressingLocator();		try {			int value = Integer.parseInt(args[1]);			EndpointReferenceType instanceEPR;			if (args[0].startsWith("http")) {				// First argument contains a URI				String serviceURI = args[0];				// Create endpoint reference to service				instanceEPR = new EndpointReferenceType();				instanceEPR.setAddress(new Address(serviceURI));			} else {				// First argument contains an EPR file name				String eprFile = args[0];				// Get endpoint reference of WS-Resource from file				FileInputStream fis = new FileInputStream(eprFile);				instanceEPR = (EndpointReferenceType) ObjectDeserializer						.deserialize(new InputSource(fis),								EndpointReferenceType.class);				fis.close();			}			// Get PortType			MathPortType math = instanceLocator					.getMathPortTypePort(instanceEPR);			// Perform addition			math.add(value);			// Access value			System.out					.println("Current value:" + math.getValueRP(new GetValueRP()));		} catch (Exception e) {			e.printStackTrace();		}	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -