• rchoi21
  • NEWBIE
  • 5 Points
  • Member since 2003

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 25
    Replies
Hi,

An update to the php_sforce_nusoap sourceforge project has been posted. It includes:

- fix for namespace of headers (lead assignment headers work properly now)
- rename of soapclient to nusoapclient (avoid conflict of php 5 SoapClient)
- getUpdated(), getDeleted() and retrieve() calls
- examples of the above in example.php

http://sourceforge.net/project/showfiles.php?group_id=96634&package_id=166314

Please send comments and feedback to rchoi21_AT_hotmail.com.

Thanks!

Ryan Choi
rchoi21_AT_hotmail.com
Hi,

An update to the php_sforce_nusoap sourceforge project has been posted. It includes support for setURL() and setSession(), as well as doing lead converts.

http://sourceforge.net/project/showfiles.php?group_id=96634&package_id=166314

I've also updated the example php file with a lead convert example.

Please send comments and feedback to rchoi21_AT_hotmail.com.

Thanks!

Ryan Choi
rchoi21_AT_hotmail.com
changes included in PHP Client release 54:

- added getUpdated() and getDeleted() calls

- added deleted.php test file showing getDeleted() usage

- included (but commented out) line to run client in cURL-unverified mode
(allows developer to test without CA cert installed)

- better comments around clientId param in SalesforceClient.php file

- moved test files to example directory


download it at http://sourceforge.net/project/showfiles.php?group_id=96634&package_id=104202
Hi,

I've written a small sforce Partner WSDL PHP library based on the NuSOAP SOAP Toolkit. It obviates the need for PHP 5 and PEAR. All you need is the salesforce.php and nusoap.php files, both of which are included in the attached zip file. Download the zip from sourceforge at:

http://osdn.dl.sourceforge.net/sourceforge/sforce/php.sforce.nusoap.20051012.zip

Most of the API methods have been implemented; feel free to recommend more. The goal of this library was to make the basic operations -- create, update, delete, query, search -- easy to do. A lot of the response objects are still native PHP types. However, I've made a point of declaring a sObject class and returning it wherever possible.

I've also included an example php file and the original nusoap.php file, so you can see what modifications I've made.

Please send comments and feedback to rchoi21_AT_hotmail.com.

Thanks!

Ryan Choi
rchoi21_AT_hotmail.com

(Sorry for the re-post. Wouldn't let me edit the URL to point to sourceforge.)
I'm using the php_sforce_nusoap created by rchoi21 but when trying to create a new Oppurtunity and sending in a CloseDate, the generated XML sets the xsi:type="xsd:string" for CloseDate. This returns the error "INVALID_TYPE_ON_FIELD_IN_RECORD". Has anyone else run into this? I tried to change the Dynamic sObject definition is the partner.wsdl file and specified CloseDate as a xsd:date type but it doesn't seem to be reading it. :-\



Any help would be greatly appreciated... this is my first post on here, so I may not have included the necessary information - let me know what might help and I'll post it.

Message Edited by satpreet on 12-19-2005 09:06 AM

We're successfully creating lead qualifier responses, but when they are displayed in www.salesforce.com in the lead, the question is displayed as an id instead of the question text. The answer text is displayed correctly. The objects we're creating look like this:

Array (
[type] => Lead_Qualifier_Response__c
[Leadid__c] => 00Q30000008CI9mEAG
[response_text__c] => Whatsamatta U
[question_text__c] => Bullwinkle's Alma Mater )

So in this example, instead of displaying "Bullwinkle's Alma Mater" as the question, it displays

What are we doing wrong?
  • November 26, 2005
  • Like
  • 0
Hi,
I'm using php_sforce_nusoap to retrieve Product information from SalesForce and load these into a local DB.
I have done multiple tests to retrieve data from production environment, the test have performed as expected. The end point in these cases is set as "https://www.salesforce.com/services/Soap/u/5.0" and is defined in partner.wsdl

Today, I tried to switch to a test environment where I modified the current endpoint to "https://test.salesforce.com/services/Soap/u/5.0"
My client can log in fine, but exactly the same query as in production environment does not return any results. I even tried the query with sforce explorer and was able to get the expected results, so obviously nothing is wrong with the query. The communication between Salesforce and my client seems to be fine, the only problem is that the result returned is always empty.
Anyone know what is going on?

Thanks.
  • November 21, 2005
  • Like
  • 0
The client I'm working for has a Lead Assignment Rule set, consisting of 17 rules with a catch-all.

I'm creating Leads with nusoap, and they're appearing in SalesForce beautifully. However, they all retain "website" as the Lead Owner. They shouldn't. They should be routed to new owners.

I believe this has to do with the useDefaultRule setting, but I've no idea how to set it with php_sforce_nusoap. Can I simply add it as a name/value pair to my sObject?

-Tony
  • November 18, 2005
  • Like
  • 0
I tested the example script: example/login.php and I got this error? has anyone seen this problem before?

thanks

Message Edited by webguru on 11-07-2005 02:31 PM

Message Edited by webguru on 11-07-2005 02:32 PM

Hi,

An update to the php_sforce_nusoap sourceforge project has been posted. It includes support for setURL() and setSession(), as well as doing lead converts.

http://sourceforge.net/project/showfiles.php?group_id=96634&package_id=166314

I've also updated the example php file with a lead convert example.

Please send comments and feedback to rchoi21_AT_hotmail.com.

Thanks!

Ryan Choi
rchoi21_AT_hotmail.com
Hi,

Salesforce is very new to me and I want to get data from Salesforce. I searched the web and I found out i can use soap to do that, I downloaded a couple of sample code (nusoap or either pear soap) and I didn't know how i can get started and got the simple application to work. For example,
$sforce = new SoapClient("$url"); // obtain your own customized sforce.wsdl from sfroce.com

what should i put in that $url? any comment or help is appreciated

thanks
Hello,
I try to insert objects using the PHP API.
All the SELECT commands work, the CREATE commands return no error, but nothing is created.
Here is my code :

$client = new SalesforceClient($result->sessionId);
$client->_endpoint = $result->serverUrl;
$client->setOpt("timeout", 60);

$query_str = "select Id,description from lead where email='$email' and isConverted=False";

$result = $client->query($query_str);

if (PEAR::isError($result))
{
print "

".$result->getMessage()."
";
print "$query_str

";
$ret=0;
}
else
{
// No lead in the database
if (count($result->records) == 0)
{
$FIELDS=array(
'type' => 'lead',
'FirstName' => utf8_encode($firstname),
'LastName' => utf8_encode($lastname),
'Title' => utf8_encode($title),
'Company' => utf8_encode(strtoupper($company)),
'Website' => utf8_encode($url),
'Email' => utf8_encode($email),
'Phone' => utf8_encode($phone),
'Street' => utf8_encode($street),
'PostalCode' => utf8_encode($zip),
'City' => utf8_encode($city),
'Country' => utf8_encode($country),
'LeadSource' => utf8_encode($know_us),
'Recevoir_les_Infos_modifi_le__c' => $info_date,
'Recevoir_les_Infos_par_email__c' => utf8_encode($info_str),
'Recevoir_la_Newsletter__c' => utf8_encode($news_str),
'Recevoir_la_Newsletter_modifie_le__c' => $nl_date,
'Origine_du_contact__c' => utf8_encode($source));
$result=$client->create($FIELDS);

if (PEAR::isError($result))
{
print ("

".$result->getMessage()."
");
print_r ("$FIELDS

");
$ret=0;
}
}
}


At the end, I have no error, but nothing is inserted...
Can someone help me please?

Thanks
Stéphane
  • October 18, 2005
  • Like
  • 0
Hello,

How Can I use getUpdated and getDeleted calls even if they aren't defined in the SalesforceClient.php file ?

Thanks !

Message Edited by PtitFred on 10-17-2005 03:55 AM

Hi,

I've written a small sforce Partner WSDL PHP library based on the NuSOAP SOAP Toolkit. It obviates the need for PHP 5 and PEAR. All you need is the salesforce.php and nusoap.php files, both of which are included in the attached zip file. Download the zip from sourceforge at:

http://osdn.dl.sourceforge.net/sourceforge/sforce/php.sforce.nusoap.20051012.zip

Most of the API methods have been implemented; feel free to recommend more. The goal of this library was to make the basic operations -- create, update, delete, query, search -- easy to do. A lot of the response objects are still native PHP types. However, I've made a point of declaring a sObject class and returning it wherever possible.

I've also included an example php file and the original nusoap.php file, so you can see what modifications I've made.

Please send comments and feedback to rchoi21_AT_hotmail.com.

Thanks!

Ryan Choi
rchoi21_AT_hotmail.com

(Sorry for the re-post. Wouldn't let me edit the URL to point to sourceforge.)

We've been using the frontdoor mechanism successfully to link into Salesforce with a valid contactId and session Id. Today, the url failed if the contactId used the 18 character format and only suceeded if the 15 character format was used. How do know which format to use? Which should we use on an on going basis?

Perplexed.

-- Mark

I've had this happen 3 times but I can't seem to ever replicate the error.  It occurs on pulls of a large number of records from salesforce via a Query (and queryMore) call.  The number of records returned is less (it has always been by 1) then then .size attribute on the QueryResult object.

In other words the .size may be 12000 but the .records contains only 11999 sobjects

Has anyone else run into this problem or is it a known problem?  I'm guessing that it could be caused by an object being deleted during the query process and the .size not being updated.

GlennW
www.demandtools.com

Message Edited by GlennW on 05-24-2004 03:18 PM

Hello,

When calling the getDeleted Method passing in OpportunityStage as the sObjectType parameter, I receive the following exception: INVALID_TYPE: sObject type OpportunityStage is not replicable.

Please confirm that it is not possible to retrieve the deleted OpportunityStage Record ID's.

If this is not possible now, will it be possible in the future?  If so, any ETA?

Development in MS Visual Studio 2003 .Net utilizing sForce 3.0 Enterprise.

Thanks
Roy

  • May 18, 2004
  • Like
  • 0

Hi,

I have a slight difference when I call search in v3.0 than in v2.5.

Id is return as an array with twice the same element.

Is it the normal behavior in v3.0 ?

I am running this query

select Id, Name from Account where Phone ='************'

with 2.5 I get

Array
(
    [0] => stdClass Object
        (
            [done] => true
            [queryLocator] => 
            [records] => stdClass Object
                (
                    [type] => Account
                    [Id] => 00130000001qpjkAAA
                    [Name] => ******                )

            [size] => 1
        )

)

with 3.0 I get

Array
(
    [0] => stdClass Object
        (
            [done] => true
            [queryLocator] => 
            [records] => stdClass Object
                (
                    [type] => Account
                    [Id] => Array
                        (
                            [0] => 00130000001qpjkAAA
                            [1] => 00130000001qpjkAAA
                        )

                    [Name] => *****                )

            [size] => 1
        )

)
here is the returned xml with v3.0
  xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<queryResponse xmlns="urn:partner.soap.sforce.com">
<result>
  <done>truedone>
  <queryLocator xsi:nil="true" />
<records xsi:type="sf:sObject" xmlns:sf="urn:sobject.partner.soap.sforce.com">
  <sf:type>Accountsf:type>
  <sf:Id>00130000001qpjkAAAsf:Id>
  <sf:Id>00130000001qpjkAAAsf:Id>
  <sf:Name>****sf:Name>
  records>
  <size>1size>
  result>
  queryResponse>
  soapenv:Body>
  soapenv:Envelope>

Message Edited by laurentb on 04-12-2004 07:00 PM

Message Edited by laurentb on 04-12-2004 07:10 PM

Message Edited by laurentb on 04-12-2004 09:37 PM

Is there a way to access the invitee/attendee list via the API?

I checked the API documentation, and searched the groups for "Invitee" and "Attendee" and didn't find anything, so I apologize if I've missed something obvious.

Thanks!

I have a composite app integrated with SFDC will a Web Integration Link (WIL.  (I'm accessing Sforce using Java with Axis 1.1.)

I noticed Saturday that it was not working using API 2.5 so I upgraded to the WSDL 3.0 and regenerated the Sforce client stubs.  This did fix the initial problems I was seeing.  (If you are currious, I was getting complaints about "nameField", which is a new element in Field in WSDL 3.0, even though I was still using 2.5).  

However further testing using 3.0 revealed an intermittent problem which I have not been able to work around.  I sometimes get the error back from the Sforce server saying that the session id is bad.

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader

Using tcpmon I have compared traces of runs where it works and where it does not work.  The server will return this error with no changes on the client side.  It will work, then not work, then work again.  So it does not appear to be a problem with the session ID obtained from the WIL, nor with the client request.  I am thinking there is an intermittent issue on the Sforce server.

Please advise.

--SergeantAgni

I know I'm jumping the gun here, but what the heck. Would it be possible to get an example or two of searchString syntax for API 3.0? I thought I might get lucky and the search signature would resemble the one from 2.0, but no such luck.
Hi
I need a new fileds on solution screen but i can't add them because there isn't option to do it. How can I add it?

Thansk
ivn.
  • April 02, 2004
  • Like
  • 0

Hello..

I need some help with the Scontrols - Especially with java applets

I am not sure if I am doing it right.. This is my java file

import java.applet.Applet;
import java.awt.Graphics;

public class Scontrol extends Applet
{
 public void paint(Graphics g)
 {
   g.drawString("Scontrol Sample",100,100);
 }
}

And this is my HTML file...

<HTML>
<HEAD>
<TITLE> A Simple Program </TITLE>
</HEAD>
<BODY>
<APPLET CODE="Scontrol.class" WIDTH=150 HEIGHT=100 >
</APPLET>
</BODY>
</HTML>

I uploaded the class file when I created the Scontrol.. I created the reference to this SCtrl in the Page layout too.. What am I missing...???

Where does the applet get loaded from...???

Could it be problem with the applet attributes..??? So .. I am not sure about the applet attributes that needs to be set .. Archives... Java Code Base .. etc..!! I am not sure where I am making mistake..!! ..

Thank you...

Chitra

  • March 16, 2004
  • Like
  • 0