📄 helloservicewsifclient.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 + -