stockquotewsifclient.java
来自「精通Jboss——Ejb和Web Services开发精解的随书源代码」· Java 代码 · 共 28 行
JAVA
28 行
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 + =
减小字号Ctrl + -
显示快捷键?