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