Results 1 to 2 of 2

Thread: set_relationship() через SOAP - Не работает

  1. #1
    Afipsky is offline Member
    Join Date
    Apr 2011
    Posts
    7

    Default set_relationship() через SOAP - Не работает

    Добрый день всем, кто открыл эту тему.
    Задача: создать связь между Клиентом и Проектом.

    Code:
    <?php
    $options = array(
    "location" => 'http://crm.ru/soap.php',
    'uri' => 'http://crm.ru',
    'trace' => 1
    );
    $user_auth = array(
    "user_name" => 'admin',
    "password" => MD5('12345'),
    "version" => '.01'
    );
    
    $client = new SoapClient(NULL, $options);
    // Login to SugarCRM
    $response = $client->login($user_auth,'test');
    $session_id = $response->id;
    
    $id_project='7bb783d6-a123-d427-d89f-4dac92e4489e';             
    $contact_id='5dd203f5-8fef-642a-e391-4da845a3648c';
    
    $response=$client->set_relationship($session_id, 'Project',$id_project,
    'Contacts', array($contact_id));
    var_dump($response);
    ?>
    var_dump говорит мне object(stdClass)#2 (3) { ["number"]=> string(2) "20" ["name"]=> string(21) "Module Does Not Exist" ["description"]=> string(43) "This module is not available on this server" }

    Обьясните, что я делаю неправильно?

  2. #2
    Afipsky is offline Member
    Join Date
    Apr 2011
    Posts
    7

    Talking Re: set_relationship() через SOAP - Не работает

    Решение приходит как всегда в последний момент =)
    Вот рабочий код, если кто-то застрял на том же месте что и я:
    Code:
    $params = (Object)array( 
            'module1' => 'Project', 
            'module1_id' => $id_project_ssh, 
            'module2' => "Contacts", 
            'module2_id' => $contact_id_email_str); 
    
    $response_project = $client ->set_relationship($session_id, $params);
    Если вывести var_dump`ом $response получим
    object(stdClass)#3 (3) { ["number"]=> string(1) "0" ["name"]=> string(8) "No Error" ["description"]=> string(8) "No Error" }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 8
    Last Post: 2010-09-16, 12:33 PM
  2. Replies: 2
    Last Post: 2010-09-12, 06:15 PM
  3. Replies: 6
    Last Post: 2010-04-15, 04:42 AM
  4. Replies: 10
    Last Post: 2009-02-09, 05:58 PM
  5. Replies: 0
    Last Post: 2009-01-23, 06:58 PM

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
  •