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>
Here's the environment :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>
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.


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks