+ Start a Discussion

'uri' option is requred in nonWSDL mode ERROR

Hi Everyone
I am getting the following error sometimes. I am using the PHP toolkit

SoapFault exception: [Client] SoapClient::__construct() [<a href='function.SoapClient---construct'>function.SoapClient---construct</a>]: 'uri' option is requred in nonWSDL mode in /home/clients/websites/w_angel/public_html/epifany/soapclient/SforceBaseClient.php:59

Stack trace:

#0 /home/clients/websites/w_angel/public_html/epifany/soapclient/SforceBaseClient.php(59): SoapClient->__construct(NULL, Array)

#1 /home/clients/websites/w_angel/public_html/epifany/selfserviceuser/SelfServiceUserUtility.php(152): SforceBaseClient->createConnection(NULL)

#2 /home/clients/websites/w_angel/public_html/epifany/ssp/hangup.php(8): SelfServiceUserUtility->__construct(NULL, NULL, NULL)

This happens sometimes, It was happening yesterday around 11.45 AM EST and last night at around 10.45 PM EST.

What can be the issue here, I don't understand. I have not changed the code at all.



Tran ManTran Man
Is this still happening?  Intermittent problems like these tell me it's a server-to-server problem.

Could you post code snippet around where it fails?


Hi Nick

The error is coming from line

    $this->sforce = new SoapClient($wsdl, array('trace' => 1, 'encoding' => 'utf-8'));

i.e in SforceBaseClient.php line 59



Hello, did you find a cause/solution for this?
I am getting the same message

thnx in advance
This is happening to me too, and it seems to have begun yesterday.

We made no changes to the code, but the server was moved (so, it's IP address changed). Literally, turn off server, move to new location, turn on server... and now we cannot connect to Salesforce.

I get the same 'uri' message as above.

Any help would be appreciated... how did you resolve the issue?
Tran ManTran Man
I was able to reproduce the problem if I passed in NULL to the createConnection call rather the WSDL.

For example, if I changed

  $mySforceConnection = new SforceEnterpriseClient();
  $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/enterprise.wsdl.xml');


  $mySforceConnection = new SforceEnterpriseClient();
  $mySoapClient = $mySforceConnection->createConnection();

 I get the error: "SoapClient::SoapClient(): 'uri' option is requred in nonWSDL mode"

So double-check that the WSDL is properly loaded.  It might help to debug the createConnection method in SforceBaseClient by printing out the WSDL.


Thanks... turns out, it was the Salesforce security token.

It took a day of digging (and turning on deeper and deeper debugging messages) before I got something back that let me know what was going on. This was the first time we moved a server outside of the corporate network -- so, we had to add a security token to the account password. All working now.