Package com.sforce.soap.partner

Examples of com.sforce.soap.partner.PartnerConnection


   
    /**
     * Verifies that fields are correct in the underlying salesforce custom object.
     */
    private void verifyFieldsOnSObject(String sObject, String[] expectedFieldNames) throws Exception {
        PartnerConnection conn = getPartnerConnection();
        String ns = getNamespaceFromCtx();
        if (ns != null && ns != "") {
            sObject = ns + NAME_SEPARATOR + sObject;
        }
        DescribeSObjectResult describeSObjectResult = conn.describeSObject(sObject);
        com.sforce.soap.partner.Field[] fields = describeSObjectResult.getFields();
        Assert.assertEquals(fields.length, expectedFieldNames.length, "Unexpected number of fields on object " + sObject);
        ArrayList<String> fieldNames = new ArrayList<String>();
        for (com.sforce.soap.partner.Field field : fields) {
            if (field.isCustom() && ns != null && ns != "") {
View Full Code Here


     * Verifies that field precisions and decimal place counts are correct
     * in the underlying salesforce custom object.
     */
    private void verifyFieldPrecisions(String sObject,
            Map<String, PrecisionScale> expectedFieldMetadata) throws Exception {
        PartnerConnection conn = getPartnerConnection();
        DescribeSObjectResult describeSObjectResult = conn.describeSObject(sObject);
        com.sforce.soap.partner.Field[] fields = describeSObjectResult.getFields();

        for (int i = 0; i < fields.length; i++) {
            if (expectedFieldMetadata.containsKey(fields[i].getName())) {
                Assert.assertEquals(
View Full Code Here

        ForceConnectorConfig conf = new ForceConnectorConfig();
        conf.setUsername(username);
        conf.setPassword(password);
        conf.setAuthEndpoint(authEndpoint);
        ForceServiceConnector conn = new ForceServiceConnector(conf);
        PartnerConnection service = conn.getConnection();
        return service;
    }
View Full Code Here

        // This will instantiate a ForceSeviceConnector with the given connectionName.
        // ForceServiceConnector f = new ForceServiceConnector("integrationserver");

        // This will use ForceServiceConnector assigned to the ThreadLocal.
        ForceServiceConnector f = new ForceServiceConnector();
        PartnerConnection conn = f.getConnection();


        GetUserInfoResult userInfoResult = conn.getUserInfo();

        StringBuffer value = new StringBuffer();
        value.append("[");
        value.append("{" + userInfoResult.getUserName() + "},");
        value.append("]");
View Full Code Here

        config.setReadTimeout(2345);
        connector = new ForceServiceConnector(config);

        // We should hit the cache here and retrieve the original read timeout
        PartnerConnection conn = connector.getConnection();
        assertEquals(conn.getConfig().getReadTimeout(), 1234);
    }
View Full Code Here

            System.setProperty("force.testCacheWithConnectionName.url", connUrl + "&timeout=2345");
            connector = new ForceServiceConnector("testCacheWithConnectionName");

            // We should hit the cache here and retrieve the original read timeout
            PartnerConnection conn = connector.getConnection();
            assertEquals(conn.getConfig().getReadTimeout(), 1234);
        } finally {
            System.clearProperty("force.testCacheWithConnectionName.url");
        }
    }
View Full Code Here

        nativeConfig.setAuthEndpoint(userInfo.getServerEndpoint());
        nativeConfig.setUsername(userInfo.getUserName());
        nativeConfig.setPassword(userInfo.getPassword());

        // Login outside of the ForceServiceConnector
        PartnerConnection conn = Connector.newConnection(nativeConfig);

        // A session id can represent a username and password
        // so this is still a valid config
        ForceConnectorConfig config = createConfig();
        config.setUsername(null);
        config.setPassword(null);
        config.setSessionId(conn.getSessionHeader().getSessionId());

        ForceServiceConnector connector = new ForceServiceConnector(config);
        connector.getConnection();

        // Since we don't have a username and password, we can't generate
View Full Code Here

TOP

Related Classes of com.sforce.soap.partner.PartnerConnection

Copyright © 2018 www.massapicom. 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.