WeatherForecastSoapStub.java
上传用户:shen332233
上传日期:2021-09-03
资源大小:7478k
文件大小:12k
源码类别:

Ajax

开发平台:

Java

  1. /**
  2.  * WeatherForecastSoapStub.java
  3.  *
  4.  * This file was auto-generated from WSDL
  5.  * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter.
  6.  */
  7. package ajaxdashboard.ws.weatherforecast;
  8. public class WeatherForecastSoapStub extends org.apache.axis.client.Stub implements ajaxdashboard.ws.weatherforecast.WeatherForecastSoap {
  9.     private java.util.Vector cachedSerClasses = new java.util.Vector();
  10.     private java.util.Vector cachedSerQNames = new java.util.Vector();
  11.     private java.util.Vector cachedSerFactories = new java.util.Vector();
  12.     private java.util.Vector cachedDeserFactories = new java.util.Vector();
  13.     static org.apache.axis.description.OperationDesc [] _operations;
  14.     static {
  15.         _operations = new org.apache.axis.description.OperationDesc[2];
  16.         _initOperationDesc1();
  17.     }
  18.     private static void _initOperationDesc1(){
  19.         org.apache.axis.description.OperationDesc oper;
  20.         org.apache.axis.description.ParameterDesc param;
  21.         oper = new org.apache.axis.description.OperationDesc();
  22.         oper.setName("GetWeatherByZipCode");
  23.         param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.webservicex.net", "ZipCode"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false);
  24.         oper.addParameter(param);
  25.         oper.setReturnType(new javax.xml.namespace.QName("http://www.webservicex.net", "WeatherForecasts"));
  26.         oper.setReturnClass(ajaxdashboard.ws.weatherforecast.WeatherForecasts.class);
  27.         oper.setReturnQName(new javax.xml.namespace.QName("http://www.webservicex.net", "GetWeatherByZipCodeResult"));
  28.         oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
  29.         oper.setUse(org.apache.axis.constants.Use.LITERAL);
  30.         _operations[0] = oper;
  31.         oper = new org.apache.axis.description.OperationDesc();
  32.         oper.setName("GetWeatherByPlaceName");
  33.         param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.webservicex.net", "PlaceName"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false);
  34.         oper.addParameter(param);
  35.         oper.setReturnType(new javax.xml.namespace.QName("http://www.webservicex.net", "WeatherForecasts"));
  36.         oper.setReturnClass(ajaxdashboard.ws.weatherforecast.WeatherForecasts.class);
  37.         oper.setReturnQName(new javax.xml.namespace.QName("http://www.webservicex.net", "GetWeatherByPlaceNameResult"));
  38.         oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
  39.         oper.setUse(org.apache.axis.constants.Use.LITERAL);
  40.         _operations[1] = oper;
  41.     }
  42.     public WeatherForecastSoapStub() throws org.apache.axis.AxisFault {
  43.          this(null);
  44.     }
  45.     public WeatherForecastSoapStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
  46.          this(service);
  47.          super.cachedEndpoint = endpointURL;
  48.     }
  49.     public WeatherForecastSoapStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
  50.         if (service == null) {
  51.             super.service = new org.apache.axis.client.Service();
  52.         } else {
  53.             super.service = service;
  54.         }
  55.         ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
  56.             java.lang.Class cls;
  57.             javax.xml.namespace.QName qName;
  58.             javax.xml.namespace.QName qName2;
  59.             java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
  60.             java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
  61.             java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
  62.             java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
  63.             java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
  64.             java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
  65.             java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
  66.             java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
  67.             java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
  68.             java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
  69.             qName = new javax.xml.namespace.QName("http://www.webservicex.net", "ArrayOfWeatherData");
  70.             cachedSerQNames.add(qName);
  71.             cls = ajaxdashboard.ws.weatherforecast.ArrayOfWeatherData.class;
  72.             cachedSerClasses.add(cls);
  73.             cachedSerFactories.add(beansf);
  74.             cachedDeserFactories.add(beandf);
  75.             qName = new javax.xml.namespace.QName("http://www.webservicex.net", "WeatherData");
  76.             cachedSerQNames.add(qName);
  77.             cls = ajaxdashboard.ws.weatherforecast.WeatherData.class;
  78.             cachedSerClasses.add(cls);
  79.             cachedSerFactories.add(beansf);
  80.             cachedDeserFactories.add(beandf);
  81.             qName = new javax.xml.namespace.QName("http://www.webservicex.net", "WeatherForecasts");
  82.             cachedSerQNames.add(qName);
  83.             cls = ajaxdashboard.ws.weatherforecast.WeatherForecasts.class;
  84.             cachedSerClasses.add(cls);
  85.             cachedSerFactories.add(beansf);
  86.             cachedDeserFactories.add(beandf);
  87.     }
  88.     protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
  89.         try {
  90.             org.apache.axis.client.Call _call = super._createCall();
  91.             if (super.maintainSessionSet) {
  92.                 _call.setMaintainSession(super.maintainSession);
  93.             }
  94.             if (super.cachedUsername != null) {
  95.                 _call.setUsername(super.cachedUsername);
  96.             }
  97.             if (super.cachedPassword != null) {
  98.                 _call.setPassword(super.cachedPassword);
  99.             }
  100.             if (super.cachedEndpoint != null) {
  101.                 _call.setTargetEndpointAddress(super.cachedEndpoint);
  102.             }
  103.             if (super.cachedTimeout != null) {
  104.                 _call.setTimeout(super.cachedTimeout);
  105.             }
  106.             if (super.cachedPortName != null) {
  107.                 _call.setPortName(super.cachedPortName);
  108.             }
  109.             java.util.Enumeration keys = super.cachedProperties.keys();
  110.             while (keys.hasMoreElements()) {
  111.                 java.lang.String key = (java.lang.String) keys.nextElement();
  112.                 _call.setProperty(key, super.cachedProperties.get(key));
  113.             }
  114.             // All the type mapping information is registered
  115.             // when the first call is made.
  116.             // The type mapping information is actually registered in
  117.             // the TypeMappingRegistry of the service, which
  118.             // is the reason why registration is only needed for the first call.
  119.             synchronized (this) {
  120.                 if (firstCall()) {
  121.                     // must set encoding style before registering serializers
  122.                     _call.setEncodingStyle(null);
  123.                     for (int i = 0; i < cachedSerFactories.size(); ++i) {
  124.                         java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
  125.                         javax.xml.namespace.QName qName =
  126.                                 (javax.xml.namespace.QName) cachedSerQNames.get(i);
  127.                         java.lang.Object x = cachedSerFactories.get(i);
  128.                         if (x instanceof Class) {
  129.                             java.lang.Class sf = (java.lang.Class)
  130.                                  cachedSerFactories.get(i);
  131.                             java.lang.Class df = (java.lang.Class)
  132.                                  cachedDeserFactories.get(i);
  133.                             _call.registerTypeMapping(cls, qName, sf, df, false);
  134.                         }
  135.                         else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) {
  136.                             org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory)
  137.                                  cachedSerFactories.get(i);
  138.                             org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory)
  139.                                  cachedDeserFactories.get(i);
  140.                             _call.registerTypeMapping(cls, qName, sf, df, false);
  141.                         }
  142.                     }
  143.                 }
  144.             }
  145.             return _call;
  146.         }
  147.         catch (java.lang.Throwable _t) {
  148.             throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
  149.         }
  150.     }
  151.     public ajaxdashboard.ws.weatherforecast.WeatherForecasts getWeatherByZipCode(java.lang.String zipCode) throws java.rmi.RemoteException {
  152.         if (super.cachedEndpoint == null) {
  153.             throw new org.apache.axis.NoEndPointException();
  154.         }
  155.         org.apache.axis.client.Call _call = createCall();
  156.         _call.setOperation(_operations[0]);
  157.         _call.setUseSOAPAction(true);
  158.         _call.setSOAPActionURI("http://www.webservicex.net/GetWeatherByZipCode");
  159.         _call.setEncodingStyle(null);
  160.         _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
  161.         _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
  162.         _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
  163.         _call.setOperationName(new javax.xml.namespace.QName("http://www.webservicex.net", "GetWeatherByZipCode"));
  164.         setRequestHeaders(_call);
  165.         setAttachments(_call);
  166.  try {        java.lang.Object _resp = _call.invoke(new java.lang.Object[] {zipCode});
  167.         if (_resp instanceof java.rmi.RemoteException) {
  168.             throw (java.rmi.RemoteException)_resp;
  169.         }
  170.         else {
  171.             extractAttachments(_call);
  172.             try {
  173.                 return (ajaxdashboard.ws.weatherforecast.WeatherForecasts) _resp;
  174.             } catch (java.lang.Exception _exception) {
  175.                 return (ajaxdashboard.ws.weatherforecast.WeatherForecasts) org.apache.axis.utils.JavaUtils.convert(_resp, ajaxdashboard.ws.weatherforecast.WeatherForecasts.class);
  176.             }
  177.         }
  178.   } catch (org.apache.axis.AxisFault axisFaultException) {
  179.   throw axisFaultException;
  180. }
  181.     }
  182.     public ajaxdashboard.ws.weatherforecast.WeatherForecasts getWeatherByPlaceName(java.lang.String placeName) throws java.rmi.RemoteException {
  183.         if (super.cachedEndpoint == null) {
  184.             throw new org.apache.axis.NoEndPointException();
  185.         }
  186.         org.apache.axis.client.Call _call = createCall();
  187.         _call.setOperation(_operations[1]);
  188.         _call.setUseSOAPAction(true);
  189.         _call.setSOAPActionURI("http://www.webservicex.net/GetWeatherByPlaceName");
  190.         _call.setEncodingStyle(null);
  191.         _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
  192.         _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
  193.         _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
  194.         _call.setOperationName(new javax.xml.namespace.QName("http://www.webservicex.net", "GetWeatherByPlaceName"));
  195.         setRequestHeaders(_call);
  196.         setAttachments(_call);
  197.  try {        java.lang.Object _resp = _call.invoke(new java.lang.Object[] {placeName});
  198.         if (_resp instanceof java.rmi.RemoteException) {
  199.             throw (java.rmi.RemoteException)_resp;
  200.         }
  201.         else {
  202.             extractAttachments(_call);
  203.             try {
  204.                 return (ajaxdashboard.ws.weatherforecast.WeatherForecasts) _resp;
  205.             } catch (java.lang.Exception _exception) {
  206.                 return (ajaxdashboard.ws.weatherforecast.WeatherForecasts) org.apache.axis.utils.JavaUtils.convert(_resp, ajaxdashboard.ws.weatherforecast.WeatherForecasts.class);
  207.             }
  208.         }
  209.   } catch (org.apache.axis.AxisFault axisFaultException) {
  210.   throw axisFaultException;
  211. }
  212.     }
  213. }