+ Reply to Thread
Results 1 to 2 of 2
This is a discussion on Optimizing Salesforce integration with CMS within the Salesforce Coding Discussions forums, part of the Salesforce category; Hi there, First off, thanks to Mike for this terrific resource (info
  1. #1
    ira42 is offline Junior Member
    Join Date
    Aug 2008
    Posts
    1

    Optimizing Salesforce integration with CMS

    Hi there,

    First off, thanks to Mike for this terrific resource (info on the Toolkit is seriously lacking on the main SF site).

    I'm working on my first SF/PHP integration project. Here's a quick overview of the functionality:

    1) Running ExpressionEngine CMS for a client's site
    2) On a particular page, I have an extension which, if the site visitor is logged in, connects to SFDC via the toolkit
    3) Using the user's email address, I have a few SOQL queries which gathers all of the user's products (Assets) and Cases from SFDC
    4) I then display the results on this page (and some others)

    I've got everything working, but am finding the SF connection routine extremely slow on our site (it takes the page ~10 seconds to load each time). I am not using any SF session ids, as I haven't found a single example of how to use them, and not sure that I need to.

    Would you have any advice on what might be slowing the page down? Is it:

    - The SF connection/login/etc
    - The SOQL queries (they are all fairly small, only querying 4-8 fields each, and never return more than ~50 results max)
    - Something on our servers (loading SOAP, CURL, WSDL, etc)
    - Something to do with not caching the WSDL?

    Or... Is it just normal that connecting to SFDC with the toolkit takes several seconds?

    Any advice is appreciated, tx!

  2. #2
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    607
    Blog Entries
    16
    Ira first off thanks for joining the site and sorry for the delay in replying, but I have been busy trying to correct some issues with our processes. I just think that it is the response time from the sforce servers, but maybe I could be completely wrong here. Some of my applications are slow, but then some are fast. I do not think that you really need to use the sessions, but here is an example on how to use sessions


    PHP Code:
    ini_set("soap.wsdl_cache_enabled","0");
    define("_WSDL_",'partner.wsdl.xml');

    require_once (
    'SforcePartnerClient.php');
    require_once (
    'SforceHeaderOptions.php'); // Salesforce Adapter - Header options

    try
    {
        
    $mySforceConnection = new SforcePartnerClient();
        
    $mySoapClient $mySforceConnection->createConnection(_WSDL_);
        
    $mylogin $mySforceConnection->login("user","passandtoken");

        
    $client = new SoapClient("WebsiteIntegrationService.wsdl");
        
    $sforce_header = new SoapHeader("http://soap.sforce.com/schemas/class/WebsiteIntegrationService","SessionHeader",array("sessionId" => $mylogin->sessionId));
        
    $client->__setSoapHeaders(array($sforce_header));
    }
    catch (
    exception $e)
    {
        echo 
    $e->faultstring;

    If you want, I can take a look at some of your code and see if I can help at all, but you totally seem to know what you are doing, so that is up to you ~Mike

+ Reply to Thread

LinkBacks (?)

  1. Hits: 1
    01-02-2009, 08:12 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO 3.5.2