NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
NUSOAP (Salesforce edition) and date problem...


Joined: 11 Oct 2006
Posts: 2
Reply with quote
Hello everybody !

I'm trying to develop a very simple PHP interface interacting with Salesforce for creating a task. code and error messages are bellow..

As a matter of fact, It's not working : no task created.

Clearly a problem of dates, but I have tried so many things...

Could somebody please help me ?

TB.

Code:
<?php
require_once('salesforce.php');
$username = 'www';
$password = 'www';
$sfdc = new salesforce('partner.wsdl');
$loginResult = $sfdc->login($username, $password);
$batchSize = new soapval('batchSize', null, 2);
$sfdc->setHeader('QueryOptions', array($batchSize));

// variables du formulaire
$action = isset($_POST['action']) ? $_POST['action'] : '';
$login = isset($_POST['login']) ? $_POST['login'] : '';
$pass = isset($_POST['pass']) ? $_POST['pass'] : '';

echo '<form action="truc" method="post">';
echo '<input type="hidden" name="action" value="1">';
echo 'codebarre: <input type="text" name="codebarre"><br />';
echo '<input type="submit" value="valider">';
echo '</form>';

if ($action !=1 ) {
   echo 'CHAIS PAS POUR TOI MAIS MOI G RIEN A FAIRE';

                 }

if ($action == 1) {
   $response = $sfdc->getServerTimestamp();
   print_r("\ngetServerTimestamp: \n\n";
   print_r($response);
   $startDate = $response;
$testDateEl = new soapval('TestDate__c', 'dateTime', '2006-12-19T19:51:12.174Z');
   // Creer La Tache
   $task = new sObject('Task',
                          null,
                          array(
                              'Status' => 'Completed',
                              'Subject' => 'Appeler',
                            'WhatId' => $idsur18car,
                              'Type' => 'A Rappeler',
                              'ActivityDate' => $testDateEl
                                )                         
                         );

   $createResult = $sfdc->create($task);

   print_r("\ncreate one: \n\n";
   print_r($createResult);

}

?>

It's not working : no task created. Clearly a problem of dates, but I have tried so many things...

Could somebody help me ?

I have the following result :

soapval Object ( [title] => NuSOAP [version] => 0.7.2 [revision] => $Revision: 1.4 $ [error_str] => [debug_str] => [charencoding] => 1 [debugLevel] => 9 [XMLSchemaVersion] => http://www.w3.org/2001/XMLSchema [soap_defencoding] => ISO-8859-1 [namespaces] => Array ( [SOAP-ENV] => http://schemas.xmlsoap.org/soap/envelope/ [xsd] => http://www.w3.org/2001/XMLSchema [xsi] => http://www.w3.org/2001/XMLSchema-instance [SOAP-ENC] => http://schemas.xmlsoap.org/soap/encoding/ ) [usedNamespaces] => Array ( ) [typemap] => Array ( [http://www.w3.org/2001/XMLSchema] => Array ( [string] => string [boolean] => boolean [float] => double [double] => double [decimal] => double [duration] => [dateTime] => string [time] => string [date] => string [gYearMonth] => [gYear] => [gMonthDay] => [gDay] => [gMonth] => [hexBinary] => string [base64Binary] => string [anyType] => string [anySimpleType] => string [normalizedString] => string [token] => string [language] => [NMTOKEN] => [NMTOKENS] => [Name] => [NCName] => [ID] => [IDREF] => [IDREFS] => [ENTITY] => [ENTITIES] => [integer] => integer [nonPositiveInteger] => integer [negativeInteger] => integer [long] => integer [int] => integer [short] => integer [byte] => integer [nonNegativeInteger] => integer [unsignedLong] => [unsignedInt] => [unsignedShort] => [unsignedByte] => [positiveInteger] => ) [http://www.w3.org/2000/10/XMLSchema] => Array ( [i4] => [int] => integer [boolean] => boolean [string] => string [double] => double [float] => double [dateTime] => string [timeInstant] => string [base64Binary] => string [base64] => string [ur-type] => array ) [http://www.w3.org/1999/XMLSchema] => Array ( [i4] => [int] => integer [boolean] => boolean [string] => string [double] => double [float] => double [dateTime] => string [timeInstant] => string [base64Binary] => string [base64] => string [ur-type] => array ) [http://soapinterop.org/xsd] => Array ( [SOAPStruct] => struct ) [http://schemas.xmlsoap.org/soap/encoding/] => Array ( [base64] => string [array] => array [Array] => array ) [http://xml.apache.org/xml-soap] => Array ( [0] => Map ) ) [xmlEntities] => Array ( [quot] => " [amp] => & [lt] => < [gt] => > [apos] => ' ) [name] => TestDate__c [type] => dateTime [value] => 2006-12-19T19:51:12.174Z [element_ns] => [type_ns] => [attributes] => ) create one:
View user's profileFind all posts by tbriqueSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
we don't support 3rd party products, including salesforce based on nusoap.
I believe that you'd contact them first, then if they find a real problem with nusoap and can point that out with a clear nusoap based code, you're welcome back.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 11 Oct 2006
Posts: 2
Reply with quote
OK, thank you for your answer.

For the records, solution is here :

$testDateEl = new soapval('ActivityDate', 'dateTime', '2006-12-19T19:51:12.174Z');

I'm no PHP /SOAP expert, but it seems that you have to use the same variable in your soapval object and in your "new task" object...

TB.
View user's profileFind all posts by tbriqueSend private message
NUSOAP (Salesforce edition) and date problem...
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic