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

📄 helloservicewsifclient.java

📁 精通Jboss——Ejb和Web Services开发精解的随书源代码
💻 JAVA
字号:
package com.liuyang.wsif.client;

import org.apache.wsif.WSIFException;
import org.apache.wsif.WSIFMessage;
import org.apache.wsif.WSIFOperation;
import org.apache.wsif.WSIFPort;
import org.apache.wsif.WSIFService;
import org.apache.wsif.WSIFServiceFactory;

public class HelloServiceWSIFClient {

	public static void main(String[] args) throws WSIFException {
		String url = "http://localhost:8080/axis/services/HelloService?wsdl";
		WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
		WSIFService service =factory.getService(url,
			"http://localhost:8080/axis/services/HelloService",
			"HelloServiceService",
			"http://localhost:8080/axis/services/HelloService",
			"HelloService");
		WSIFPort port = service.getPort();		
		WSIFOperation operation = port.createOperation("sayHello","sayHelloRequest",null);
		WSIFMessage input = operation.createInputMessage();
		input.setObjectPart("name", "liuyang");		
		WSIFMessage output = operation.createOutputMessage();
		WSIFMessage fault = operation.createFaultMessage();		
		operation.executeRequestResponseOperation(input, output, fault);
		System.out.println(output.getObjectPart("sayHelloReturn"));		
	}
}

⌨️ 快捷键说明

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