首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Salesforce to magento集成

Salesforce to magento集成
EN

Stack Overflow用户
提问于 2013-01-07 15:06:58
回答 3查看 1.3K关注 0票数 2
代码语言:javascript
复制
    //Create a new partner object
     $connection = new SforcePartnerClient();

     //Create the SOAP connection
     try {
          $connection->createConnection(salesforce_wsdl);
     } catch (Exception $e) {
          //Salesforce could be down, or you have an error in configuration
          //Check your WSDL path
          echo "Salesforce could be down";
     }

     //Pass login details to Salesforce
     try {
          $connection->login(salesforce_username, salesforce_password . salesforce_token);
     } catch (Exception $e) {
          //Make sure your username and password is correct
            echo "usename/password incorrect";
     }

     //Describing the Leads object and printing the array
     $describe = $connection->describeSObjects(array('Lead'));
     print_r($describe);

     //Create New Lead
     $leadFirstName = "John";
     $leadLastName = "Doe";
     $leadCompany = "abc";
     $leadEmail = "chetan@abc.com";

     //Creating the Lead Object
     $lead = new sObject();
     $lead->type = 'Lead';
     $lead->fields = array(
          'FirstName' => $leadFirstName,
          'LastName' => $leadLastName,
          'Company' => $leadCompany,
          'Email' => $leadEmail
     );

     //Submitting the Lead to Salesforce
     $result = $connection->create(array($lead), 'Lead');

这是我的代码。我只是想在salesforce中创建一个使用此代码的lead。这是salesforce的php工具包示例代码。

但是当我试图运行这段代码时。它不会在salesforce中产生任何潜在客户。我的登录凭证是正确的,安全令牌也是正确的。

我哪里错了?我使用免费的开发人员帐户和以下代码在partner.wsdl.xml中进行连接:

代码语言:javascript
复制
 <!-- Soap Service Endpoint -->
    <service name="SforceService">
        <documentation>Sforce SOAP API</documentation>
        <port binding="tns:SoapBinding" name="Soap">
            <soap:address location="https://login.salesforce.com/services/Soap/c/26.0"/>
        </port>
    </service>
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2013-01-23 20:00:09

我确实打印了result的值,但它不能正常工作。当我使用合作伙伴wsdl时,我将新的SObject()更改为新的stdClass(),它起作用了。:)

票数 0
EN

Stack Overflow用户

发布于 2013-01-10 09:41:46

我很高兴你解决了这个问题。只是为了指出,描述销售线索和打印结果的区域并不是必需的,例如,它就在那里。

票数 0
EN

Stack Overflow用户

发布于 2014-12-18 11:07:54

我知道一个很棒的magento扩展,它可以为您完成所有这些,甚至更多:https://products.crunchyconsulting.com/crunchy-products/crunchy-magforce.html

看看help & docs选项卡,在那里你甚至可以找到演示屏幕视频:

https://www.youtube.com/watch?v=TjxvjGcAGqY

https://www.youtube.com/watch?v=cmf4Ksv3uRM

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14191389

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档