public Object invoke()

in src/main/java/com/vmware/vim25/ws/WSClient.java [92:126]


    public Object invoke(String methodName, Argument[] paras, String returnType) throws RemoteException {
        if (log.isTraceEnabled()) {
            log.trace("Invoking method: " + methodName);
        }
        String soapMsg = marshall(methodName, paras);

        InputStream is = null;
        try {
            is = post(soapMsg);
            if (log.isTraceEnabled()) {
                log.trace("Converting xml response from server to: " + returnType);
            }
            return unMarshall(returnType, is);
        }
        catch (Exception e1) {
            log.error("Exception caught while invoking method: " + methodName, e1);
            // Fixes issue-28 still need to write a test which may require
            // further refacotring but this at least gets the InvalidLogin working.
            try {
                throw (RemoteException) e1;
            }
            catch (ClassCastException ignore) {
                throw new RemoteException("Exception caught trying to invoke method " + methodName, e1);
            }
        }
        finally {
            if (is != null) {
                try {
                    is.close();
                }
                catch (IOException ignored) {
                }
            }
        }
    }