client.java

来自「globus toolkit Math例子」· Java 代码 · 共 47 行

JAVA
47
字号
package org.globus.examples.clients.MathService_instance;import org.apache.axis.message.addressing.Address;import org.apache.axis.message.addressing.EndpointReferenceType;import org.globus.examples.stubs.MathService_instance.MathPortType;import org.globus.examples.stubs.MathService_instance.GetValueRP;import org.globus.examples.stubs.MathService_instance.service.MathServiceAddressingLocator;public class Client {	public static void main(String[] args) {		MathServiceAddressingLocator locator = new MathServiceAddressingLocator();		try {			String serviceURI = args[0];			// Create endpoint reference to service			EndpointReferenceType endpoint = new EndpointReferenceType();			endpoint.setAddress(new Address(serviceURI));			MathPortType math = locator.getMathPortTypePort(endpoint);			// Get PortType			math = locator.getMathPortTypePort(endpoint);			// Perform an addition			math.add(10);			// Perform another addition			math.add(5);			// Access value			System.out.println("Current value: "					+ math.getValueRP(new GetValueRP()));			// Perform a subtraction			math.subtract(5);			// Access value			System.out.println("Current value: "					+ math.getValueRP(new GetValueRP()));		} catch (Exception e) {			e.printStackTrace();		}	}}

⌨️ 快捷键说明

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