Examples of ServiceContent


Examples of com.vmware.vim25.ServiceContent

        ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);

        ctxt.put("com.sun.xml.internal.ws.request.timeout", 600000);
        ctxt.put("com.sun.xml.internal.ws.connect.timeout", 600000);

        ServiceContent serviceContent = vimPort.retrieveServiceContent(SVC_INST_REF);

        // Extract a cookie. See vmware sample program com.vmware.httpfileaccess.GetVMFiles
        Map<String, List<String>> headers = (Map<String, List<String>>) ((BindingProvider) vimPort)
                .getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
        List<String> cookies = headers.get("Set-cookie");
        String cookieValue = cookies.get(0);
        StringTokenizer tokenizer = new StringTokenizer(cookieValue, ";");
        cookieValue = tokenizer.nextToken();
        String pathData = "$" + tokenizer.nextToken();
        serviceCookie = "$Version=\"1\"; " + cookieValue + "; " + pathData;

        vimPort.login(serviceContent.getSessionManager(), userName, password, null);
        isConnected = true;

        propCollectorRef = serviceContent.getPropertyCollector();
    }
View Full Code Here

Examples of com.vmware.vim25.ServiceContent

        ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);

        ctxt.put("com.sun.xml.internal.ws.request.timeout", vCenterSessionTimeout);
        ctxt.put("com.sun.xml.internal.ws.connect.timeout", vCenterSessionTimeout);

        ServiceContent serviceContent = vimPort.retrieveServiceContent(svcInstRef);

        // Extract a cookie. See vmware sample program com.vmware.httpfileaccess.GetVMFiles
        @SuppressWarnings("unchecked")
        Map<String, List<String>> headers = (Map<String, List<String>>)((BindingProvider)vimPort).getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
        List<String> cookies = headers.get("Set-cookie");
        String cookieValue = cookies.get(0);
        StringTokenizer tokenizer = new StringTokenizer(cookieValue, ";");
        cookieValue = tokenizer.nextToken();
        String pathData = "$" + tokenizer.nextToken();
        serviceCookie = "$Version=\"1\"; " + cookieValue + "; " + pathData;

        vimPort.login(serviceContent.getSessionManager(), userName, password, null);
        isConnected = true;
    }
View Full Code Here

Examples of com.vmware.vim25.ServiceContent

        ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);

        ctxt.put("com.sun.xml.internal.ws.request.timeout", 1200000);
        ctxt.put("com.sun.xml.internal.ws.connect.timeout", 1200000);

        ServiceContent serviceContent = vimPort.retrieveServiceContent(SVC_INST_REF);

        // Extract a cookie. See vmware sample program com.vmware.httpfileaccess.GetVMFiles
        Map<String, List<String>> headers = (Map<String, List<String>>) ((BindingProvider) vimPort)
                .getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
        List<String> cookies = headers.get("Set-cookie");
        String cookieValue = cookies.get(0);
        StringTokenizer tokenizer = new StringTokenizer(cookieValue, ";");
        cookieValue = tokenizer.nextToken();
        String pathData = "$" + tokenizer.nextToken();
        serviceCookie = "$Version=\"1\"; " + cookieValue + "; " + pathData;

        vimPort.login(serviceContent.getSessionManager(), userName, password, null);
        isConnected = true;
    }
View Full Code Here

Examples of com.vmware.vim25.ServiceContent

        ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);

        ctxt.put("com.sun.xml.internal.ws.request.timeout", vCenterSessionTimeout);
        ctxt.put("com.sun.xml.internal.ws.connect.timeout", vCenterSessionTimeout);

        ServiceContent serviceContent = vimPort.retrieveServiceContent(SVC_INST_REF);

        // Extract a cookie. See vmware sample program com.vmware.httpfileaccess.GetVMFiles
        Map<String, List<String>> headers = (Map<String, List<String>>) ((BindingProvider) vimPort)
                .getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
        List<String> cookies = (List<String>) headers.get("Set-cookie");
        String cookieValue = cookies.get(0);
        StringTokenizer tokenizer = new StringTokenizer(cookieValue, ";");
        cookieValue = tokenizer.nextToken();
        String pathData = "$" + tokenizer.nextToken();
        serviceCookie = "$Version=\"1\"; " + cookieValue + "; " + pathData;

        vimPort.login(serviceContent.getSessionManager(), userName, password, null);
        isConnected = true;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.