Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

php and soap with success


Guest

Recommended Posts

Hello Everyone,

 

I have been working on a function to integrate some data using SOAP from website into a CRM. To not drag this on forever, I can successfully have the two talking (website and CRM) but cannot seem to get all of the appropriate fields I need from website to CRM, only a few (like firstname, lastname, email). I believe this is a syntax or simply not seeing the obvious error. :)

 

Below is the coding for the class function:

 

	function CreateContact($firstname, $lastname, $email_address, $telephone) {

$crm_soap_array = array('user_name'=>$this->user_name, 'password'=>md5($this->password),
							  'first_name' => $firstname,
							  'last_name' => $lastname,
							  'email_address' => $email_address,
							  'phone_work' => $telephone,
			'phone_fax' => $fax,
			'status' => "New",
			'lead_source' => "Website",
			'lead_source_description' => "nothing for now",
			'account_name' => $company,);

return $this->soap_client->call('create_lead',$crm_soap_array);
}

 

Below is the coding on the webpage to call to this function:

 

require('admin/nusoap/nusoap.php');
require(DIR_WS_CLASSES . "crm.php");

$sugar_client = new CRM();  //define client to talk to CRM

// Create a session
$sugar_client->CreateSession();
// add contact
$sugar_client->CreateContact($firstname, $lastname, $email_address, $telephone);
$sugar_client->EndSession();

 

Anyway this is extremely bizzar because the $telephone is NOT getting input into the CRM from the website. However, even if I have $lastname in the $telephone spot, noting still. What I mean by this is that the $telephone data IS there, it just isn't getting input into CRM.

 

The problem is that I have tried this for the other criteria too (status, lead_source, phone_fax, etc) with it not going in. It seems like all I can do it input firstname, lastname and email address correctly.

 

Do you see anything that pops out right off the bat? Anything you would recommend that I could try? Again, the connection to the CRM is successful, just can't seem to input anything other than firstname, lastname and email.

Link to comment
Share on other sites

I think there is no way to know without seeing

$this->soap_client->call

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

I think there is no way to know without seeing

$this->soap_client->call

 

Monika! How have things been going?

 

Here is some more from that sugarcrm.php. Let me know if this helps:

 

class SugarCRM {


var $user_name	 =	'CORRECTUSERNAME';	 // This is your CRM user name
var $password   =	'CORRECTPASSWORD';	 // This is your password for CRM user

var $soap_client;
var $sugar_service_url = "HTTP://MYSUGARCRMINSTALLATION/crm/soap.php";	// point to where soap.php is located on your installation



// Constructor
function SugarCRM() {

	$this->soap_client = new soapclient($this->sugar_service_url);
// Create a session by passing a valid user and pword

	return;
}

function CreateSession() {
$this->soap_client->call('create_session', array('user_name'=>$this->user_name, 'password'=>md5($this->password)));
return;
}

function EndSession() {
$this->soap_client->call('end_session', array('user_name'=>$this->user_name));
return;
}

 

Anything else you need on my end to understand this better? Or any commands I could put in the create_account.php that will shoot me the information it is trying to post?

Link to comment
Share on other sites

you need to find a function called "call" me thinks....

 

this winter was an adventure for me, filled with work and the flu

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...