Package com.vmware.vim25.ws
Class ApacheHttpClient
java.lang.Object
com.vmware.vim25.ws.SoapClient
com.vmware.vim25.ws.ApacheHttpClient
- All Implemented Interfaces:
Client
Created by Michael Rice on 8/12/14.
Copyright 2014 Michael Rice
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
Field Summary
Fields inherited from class com.vmware.vim25.ws.SoapClient
baseUrl, connectTimeout, cookie, readTimeout, soapAction, thumbprint, trustManager, vimNameSpace -
Constructor Summary
ConstructorsConstructorDescriptionApacheHttpClient(String url) ApacheHttpClient(String serverUrl, boolean ignoreCert) Primary constructorApacheHttpClient(String serverUrl, boolean ignoreCert, TrustManager trustManager) -
Method Summary
Modifier and TypeMethodDescriptionInvoke a given method with suppliedArgumenton the remote vi server.invokeAsString(String methodName, Argument[] paras) Invoke a given method with suppliedArgumenton the remote vi server.Methods inherited from class com.vmware.vim25.ws.SoapClient
computeX509CertificateThumbprint, getBaseUrl, getConnectTimeout, getCookie, getReadTimeout, getServerThumbprint, getTrustManager, getVimNameSpace, hexify, marshall, readStream, setBaseUrl, setConnectTimeout, setCookie, setReadTimeout, setServerThumbprint, setSoapActionOnApiVersion, setVimNameSpace, unMarshall
-
Constructor Details
-
ApacheHttpClient
Primary constructor- Parameters:
serverUrl-Stringof the url to the vi serverignoreCert-booleanto check or ignore ssl. Default ignore- Throws:
MalformedURLException
-
ApacheHttpClient
public ApacheHttpClient(String serverUrl, boolean ignoreCert, TrustManager trustManager) throws MalformedURLException - Throws:
MalformedURLException
-
ApacheHttpClient
- Parameters:
url-- Throws:
MalformedURLException
-
-
Method Details
-
invoke
Invoke a given method with suppliedArgumenton the remote vi server. This method typically creates the payload needed to send to the vi server. For example you would pass in RetrieveServiceContent for the methodName, next the params needed for the method. Next give the returnType the parser should convert the response to in this case the string ServiceContentReturns an
Objectof the given return type. Using the example above you would get aServiceContentObject.- Parameters:
methodName- Name of the method to executeparas- Array of Arguments aka params for the methodreturnType- String name of the return type- Returns:
- Object
- Throws:
RemoteException
-
invokeAsString
Invoke a given method with suppliedArgumenton the remote vi server. Returns aStringBufferThis works the same as the above call except there is no conversion done on the return data and instead you just get back the StringBuffer content.- Parameters:
methodName- Name of the method to executeparas- Array of Arguments aka params for the method- Returns:
- StringBuffer with the
- Throws:
RemoteException
-