📄 stockquotewsifclient.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 StockQuoteWSIFClient {
public static void main(String[] args) throws WSIFException {
String url = "http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl";
WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
WSIFService service =factory.getService(url,
"http://www.themindelectric.com/wsdl/net.xmethods.services.stockquote.StockQuote/",
"net.xmethods.services.stockquote.StockQuoteService",
"http://www.themindelectric.com/wsdl/net.xmethods.services.stockquote.StockQuote/",
"net.xmethods.services.stockquote.StockQuotePortType");
WSIFPort port = service.getPort();
WSIFOperation operation = port.createOperation("getQuote","getQuoteRequest1",null);
WSIFMessage input = operation.createInputMessage();
input.setObjectPart("symbol", "ibm");
WSIFMessage output = operation.createOutputMessage();
WSIFMessage fault = operation.createFaultMessage();
operation.executeRequestResponseOperation(input, output, fault);
System.out.println(output.getObjectPart("Result"));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -