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

📄 xmethodsstockquoteservicestub.java

📁 Oracle的J2EE Sample
💻 JAVA
字号:
package oracle.otnsamples.ibfbs.admin.helper;

import oracle.soap.transport.http.OracleSOAPHTTPConnection;
import java.net.URL;
import org.apache.soap.Constants;
import org.apache.soap.Fault;
import org.apache.soap.SOAPException;
import org.apache.soap.rpc.Call;
import org.apache.soap.rpc.Parameter;
import org.apache.soap.rpc.Response;
import java.util.Vector;
import java.util.Properties;

/**
 * Generated by the Oracle9i JDeveloper Web Services Stub/Skeleton Generator.
 * Date Created: Fri Apr 19 15:45:47 IST 2002
 * WSDL URL: http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl
 *
 * net.xmethods.services.stockquote.StockQuote web service
 */
public class XMethodsStockQuoteServiceStub {

  public String endpoint = "http://66.28.98.121:9090/soap";
  
  private OracleSOAPHTTPConnection m_httpConnection = null;
  
  public XMethodsStockQuoteServiceStub() {
    m_httpConnection = new OracleSOAPHTTPConnection();
  }
  
  public Float getQuote(String symbol)
      throws Exception {
    Float returnVal = null;
    URL endpointURL = new URL(endpoint);
    Call call = new Call();
    call.setSOAPTransport(m_httpConnection);
    call.setTargetObjectURI("urn:xmethods-delayed-quotes");
    call.setMethodName("getQuote");
    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
    Vector params = new Vector();
    params.addElement(new Parameter("symbol", String.class, symbol, null));
    call.setParams(params);
    Response response = call.invoke(endpointURL,
                                   "urn:xmethods-delayed-quotes#getQuote");
    if(!response.generatedFault()) {
      Parameter result = response.getReturnValue();
      returnVal = (Float)result.getValue();
    }
    else {
      Fault fault = response.getFault();
      throw new SOAPException(fault.getFaultCode(), fault.getFaultString());
    }
    return returnVal;
  }
  
  public void setMaintainSession(boolean maintainSession) {
    m_httpConnection.setMaintainSession(maintainSession);
  }
  
  public boolean getMaintainSession() {
    return m_httpConnection.getMaintainSession();
  }
  
  public void setTransportProperties(Properties props) {
    m_httpConnection.setProperties(props);
  }
  
  public Properties getTransportProperties() {
    return m_httpConnection.getProperties();
  }
  
}

⌨️ 快捷键说明

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