Results 1 to 2 of 2

Thread: soap API: session problem

  1. #1
    mattV is offline Junior Member
    Join Date
    Mar 2007
    Posts
    1

    Default soap API: session problem

    Hello,

    I'm currently trying to integrate an application with SugarCRM using its soap API. I've just performed a simple exercise : login, get the user id and logout.
    I can login, but when I reuse the session id to perform another call, I get a "-1" answer for the getuser_id operation and a 'no session occurred' answer for the logout operation.


    Here are my soap requests and the responses that I get back :

    Login :

    Code:
    <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sug="http://www.sugarcrm.com/sugarcrm">
       <soapenv:Header/>
       <soapenv:Body>
          <sug:login soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
             <user_auth xsi:type="sug:user_auth">
                <user_name xsi:type="xsd:string">cartman</user_name>
                <password xsi:type="xsd:string">74d186de7fa2f444067e76e7abab1a02</password>
                <version xsi:type="xsd:string">?</version>
             </user_auth>
             <application_name xsi:type="xsd:string">?</application_name>
          </sug:login>
       </soapenv:Body>
    </soapenv:Envelope>
    Code:
    <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://www.sugarcrm.com/sugarcrm" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <SOAP-ENV:Body>
          <ns1:loginResponse xmlns:ns1="http://www.sugarcrm.com/sugarcrm">
             <return xsi:type="tns:set_entry_result">
                <id xsi:type="xsd:string">28386530ff712aa80837e7a58839732c</id>
                <error xsi:type="tns:error_value">
                   <number xsi:type="xsd:string">0</number>
                   <name xsi:type="xsd:string">No Error</name>
                   <description xsi:type="xsd:string">No Error</description>
                </error>
             </return>
          </ns1:loginResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>


    getuser_id


    Code:
    <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sug="http://www.sugarcrm.com/sugarcrm">
       <soapenv:Header/>
       <soapenv:Body>
          <sug:get_user_id soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
             <session xsi:type="xsd:string">28386530ff712aa80837e7a58839732c</session>
          </sug:get_user_id>
       </soapenv:Body>
    </soapenv:Envelope>
    Code:
    <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <SOAP-ENV:Body>
          <ns1:get_user_idResponse xmlns:ns1="http://www.sugarcrm.com/sugarcrm">
             <return xsi:type="xsd:string">-1</return>
          </ns1:get_user_idResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    and finally, logout :


    Code:
    <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sug="http://www.sugarcrm.com/sugarcrm">
       <soapenv:Header/>
       <soapenv:Body>
          <sug:logout soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
             <session xsi:type="xsd:string">28386530ff712aa80837e7a58839732c</session>
          </sug:logout>
       </soapenv:Body>
    </soapenv:Envelope>


    Code:
    <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://www.sugarcrm.com/sugarcrm" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <SOAP-ENV:Body>
          <ns1:logoutResponse xmlns:ns1="http://www.sugarcrm.com/sugarcrm">
             <return xsi:type="tns:error_value">
                <number xsi:type="xsd:string">-1</number>
                <name xsi:type="xsd:string">An Undefined Error - no_session occured</name>
                <description xsi:type="xsd:string">There is no error definition for no_session</description>
             </return>
          </ns1:logoutResponse>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Here's the environment :

    sugarcrm OS Version 4.5.1b (Build 1246)
    apache 2.0.58
    mysql 5.0.26
    php 5.2.1
    gentoo linux 2006.1

    I tried this with the demo sugarcrm (demo.sugarondemand.com) instance (same version as mine) too and it worked without any problems.

    What could be wrong ?

    Thank you for your help.

  2. #2
    AxlAntos is offline Junior Member
    Join Date
    Aug 2007
    Posts
    3

    Default Re: soap API: session problem

    Hi,
    i posted a help request about the same thing in SOAP GET_USER_ID problem.

    Do you have found the solution?

    i'm being mad!!!!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Cannot Install SugarCRM, MBString Problem
    By Bart Boy in forum Help
    Replies: 2
    Last Post: 2010-02-26, 10:04 AM
  2. Replies: 0
    Last Post: 2006-09-21, 10:20 PM
  3. Replies: 16
    Last Post: 2006-07-29, 07:28 PM
  4. Problem with SOAP
    By marco.rizzetto in forum Help
    Replies: 3
    Last Post: 2006-07-19, 09:53 AM
  5. Cron - Sugar Log Error
    By aguerrave in forum Help
    Replies: 9
    Last Post: 2006-05-10, 10:57 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
  •