Sorry about posting the whole error. Basically I have two functions that are running on the soap server and work great. I've added a third function 'getk' that does nothing more complicated that the others. Accepts two parameters and returns an array. However when calling this function client side I get the following error.
Fatal error: Uncaught SoapFault exception:
[SOAP-ENV:Server] Function name must be a string in /home/od2u/public_html/wp-content/plugins/link-monitor/link-monitor.php:33
Stack trace: #0 [internal function]: SoapClient->__call('getk', Array)
#1 /home/od2u/public_html/wp-content/plugins/link-monitor/link-monitor.php(33): SoapClient->getk('3', 'wpmu1')
#2 /home/od2u/public_html/wp-content/themes/twentyten/header.php(18): wsfKeywords('3', 'wpmu1')
#3 /home/od2u/public_html/wp-includes/theme.php(1086): require_once('/home/od2u/publ...')
#4 /home/od2u/public_html/wp-includes/theme.php(1062): load_template('/home/od2u/publ...', true)
#5 /home/od2u/public_html/wp-includes/general-template.php(34): locate_template(Array, true)
#6 /home/od2u/public_html/wp-content/themes/twentyten/index.php(16): get_header()
#7 /home/od2u/public_html/wp-includes/template-loader.php(43): include('/home/od2u/publ...')
#8 /home/od2u/public_html/wp-blog-header.php(16): require_once('/home/od2u/publ...')
#9 /home/od2u/public_html/index.php(17): require( in /home/od2u/public_html/wp-content/plugins/link-monitor/link-monitor.php on line 33
I have looked everywhere for advice on how to sort this. The functions does exist, it isn't anything silly like a dollar sign or using the wrong type of parenthesis.
I have also cleared and disabled caching of the WSDL server and client side.
Client side call:
$c->getk($site, $server);
$c is the soap client and getk is the function name.
Function server side:
function getk($website, $server)
{
$ret_array('blah', 'blah2', 'blah3');
return $ret_array;
}
And this is added to the soap server using:
$server->addFunction(array("getk", "getLinks", "getDirectLinks"));
Hope you guys can help :)
I think, the problem is in
$ret_array('blah', 'blah2', 'blah3');
Interpreter try to resolve this as function call, but can't find variable $ret_array
I had the same error and after some deeper examination, the problem appeared to be on the side of the Soap-server.
The called routine (in this example the getk() function) produced a fatal error which resulted in the Soap-server not giving a proper response that could be interpreted by the Soap-client.
If someone has the same error, please check the errorlogs of the Soap-server if possible. You will propably find that the called function produces a fatal error and is "thus" not returning any xml.
Related
I am calling this function in cloud code (it's a pretty simple search function to get around the fact that the php sdk has no "contains") :
Parse.Cloud.define("searchVenues", function(request,response) {
var query = new Parse.Query("Venue");
query.contains("nameLowercase",request.params.term);
query.find({
success: function(results){
response.success(results);
},error: function(){
response.error("Cloud Venue search failed");
}
});
});
I am calling it in a php script as follows:
$search_result = ParseCloud::run("searchVenues", ["term" => $term]);
This function used to work! But now I am getting an error and the following stack trace:
: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 1 to be string, array given' in C:\xampp\htdocs\bcweb\vendor\parse\php-sdk\src\Parse\ParseObject.php:683
Stack trace:
#0 C:\xampp\htdocs\bcweb\vendor\parse\php- sdk\src\Parse\ParseObject.php(683): DateTime->__construct(Array)
#1 C:\xampp\htdocs\bcweb\vendor\parse\php-sdk\src\Parse\ParseObject.php(631): Parse\ParseObject->_mergeMagicFields(Array)
#2 C:\xampp\htdocs\bcweb\vendor\parse\php-sdk\src\Parse\ParseObject.php(599): Parse\ParseObject->mergeFromServer(Array, true)
#3 C:\xampp\htdocs\bcweb\vendor\parse\php-sdk\src\Parse\ParseClient.php(198): Parse\ParseObject->_mergeAfterFetch(Array)
#4 C:\xampp\htdocs\bcweb\vendor\parse\php-sdk\src\Parse\ParseClient.php(209): Parse\ParseClient::_decode(Array)
#5 C:\xampp\htdocs\bcweb\vendor\parse\php-sdk\src\Parse\ParseCloud.php(35): Parse\ParseClient::_decode(Array)
#6 C:\xampp\htdocs\bcweb\lrs\makeCrawl.php(21): Parse\ParseCloud::run('searchVenues', Array)
#7 {main}
I can't imagine what happened to break this? I have a companion function that creates the nameLowercase field on new records, as well. This was there during the happy times when the function worked correctly, so I can't imagine it's existence has anything to do with the error:
Parse.Cloud.beforeSave("Venue", function(request, response) {
if (request.object.get("name")) {
request.object.set("nameLowercase",request.object.get("name").toLowerCase());
}
response.success();
});
There are some single quotes in the strings, but they were there before too. Can anyone who has knowledge of the parse php-sdk explain what may be the problem here? Thanks!
The error was in the parse php-sdk. Updating the php-sdk to version 1.1.9 fixed this problem, and the code works as it did before.
I'm writing a plugin for openVBX.
I need to store some stuff in a table I made in the OpenVBX database.
OpenVBX Provides a helper method (PluginData::sqlQuery) to run queries but no way to escape them, so I decided to open a new PDO connection in my plugin page, but I'm getting this error:
Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in
/home/elitecallcenter/public_html/ivr/plugins/QPage/qpage.php:119
Stack trace: #0
/home/elitecallcenter/public_html/ivr/plugins/QPage/qpage.php(119):
PDOStatement->execute(Array) #1
/home/elitecallcenter/public_html/ivr/OpenVBX/views/page/index.php(7):
include_once('/home/elitecall...') #2
/home/elitecallcenter/public_html/ivr/system/libraries/Loader.php(677):
include('/home/elitecall...') #3
/home/elitecallcenter/public_html/ivr/system/libraries/Loader.php(307):
CI_Loader->_ci_load(Array) #4
/home/elitecallcenter/public_html/ivr/OpenVBX/libraries/Template.php(388):
CI_Loader->view('page/index', Array, true) #5
/home/elitecallcenter/public_html/ivr/OpenVBX/libraries/MY_Controller.php(455):
CI_Template->write_view('content', 'page/index', Array) #6
/home/elitecallcenter/public_html/ivr/OpenVBX/libraries/MY_Controller.php(498):
MY_Controller->template_respond('Phone Apps', 'page/index', Array, 'yu
in /home/elitecallcenter/public_html/ivr/plugins/QPage/qpage.php on
line 119
Line 119 is my execute call for a prepared statement.
How can I resolve this?
How large / heavy is the query? Generally you get MySQL server has gone away as a timeout.
You could try raising 'wait_timeout' in my.cnf to something more suitable or try raising 'max_allowed_packet' to '128M'.
I figured out that it was written in codeigniter, so I'm reading up on that to figure out the best way to do this. In the mean time, I've got a functioning workaround set up that involves making a cURL request to another script in the base directory that is able to connect to the database.
I never use PDO on my project, especially serialize and unserialize. But I got this error.
Fatal error: Class
'Symfony\Component\HttpKernel\Exception\FlattenException' not found in
/var/www/test/mikroskil/mikroweb/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
on line 56 Fatal error: Uncaught exception 'PDOException' with message
'You cannot serialize or unserialize PDO instances' in [no active
file]:0 Stack trace: #0 [internal function]: PDO->__sleep() #1
[internal function]: session_write_close() #2 {main} thrown in [no
active file] on line 0
it's so frustrating. Anybody can help me? It appears suddenly when i refresh my page.
Note :
I have an error before.
I use a form with POST method. And then i put a session on it.
After that, i got this error.
failed to start the session: already started by php ($_session is
set).
I tried to fix that error. But suddenly the page is showing this error
Fatal error: Class
'Symfony\Component\HttpKernel\Exception\FlattenException' not found in
/var/www/test/mikroskil/mikroweb/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
on line 56 Fatal error: Uncaught exception 'PDOException' with message
'You cannot serialize or unserialize PDO instances' in [no active
file]:0 Stack trace: #0 [internal function]: PDO->__sleep() #1
[internal function]: session_write_close() #2 {main} thrown in [no
active file] on line 0
I have recently had this issue and the problem was I was storing my model on session (which has active pdo connection inside) and when the request is done, php automatically try to serialize $_SESSION to store on tmp file.
The main problem is PDO connection can not be serialized. If you encounter this issue, you need to check where do you serialize any object that contains active pdo connection.
I have found this answer.
You just need to clear your Cookies on your browser.
Maybe the previous error has been create a cookies and cannot replace it.
i try to clear all my browser cookies and it successfull !
:)
I had the same error when using Medoo PHP Framework, I realized you cannot encode(serialize) a PDOStatement instances.
In my case I was using PHP json_encode to encode data to be sent to my appliction and part of that data contained the PDOStatement instances - data returned after executing a database operation. I just removed the PDOStatement instances from my data and everything worked okay.
I got this too but reading this question and, especially, zerkms responses helped me locate the problem in my code. Clearing one's cache is not an appropriate response to the problem! Having recently re-vamped my classes to use dependency-injection (?), storing them as session variables is no longer appropriate.
UPDATE: Krumo seems to be outdated, and I discovered Kint, which does everything I wanted out of Krumo.
I started a CI site that uses PHP ActiveRecord. Please note: PHP ActiveRecord is not the same as CI ActiveRecord.
ActiveRecord works great; more than I hoped for.
I then added Krumo, which also works great, sometimes; Krumo works properly unless I run Krumo on an ActiveRecord object.
print_r($this->user); // Works
krumo($this->user); // Does not work
The output for the krumo() call is:
Fatal error: Uncaught exception 'ActiveRecord\UndefinedPropertyException' with message 'Undefined property: User_model->krumo50afd2e8f24af in /Users/ted/Sites/cnc/sparks/php-activerecord/0.0.2/vendor/php-activerecord/lib/Model.php on line 514' in /Users/ted/Sites/cnc/sparks/php-activerecord/0.0.2/vendor/php-activerecord/lib/Model.php:514 Stack trace: #0 /Users/ted/Sites/cnc/sparks/php-activerecord/0.0.2/vendor/php-activerecord/lib/Model.php(333): ActiveRecord\Model->read_attribute('krumo50afd2e8f2...') #1 /Users/ted/Sites/cnc/application/libraries/krumo/Krumo.php(951): ActiveRecord\Model->__get('krumo50afd2e8f2...') #2 /Users/ted/Sites/cnc/application/libraries/krumo/Krumo.php(1104): krumo::_vars(Object(User_model)) #3 /Users/ted/Sites/cnc/application/libraries/krumo/Krumo.php(789): krumo::_object(Object(User_model), '...') #4 /Users/ted/Sites/cnc/application/libraries/krumo/Krumo.php(584): krumo::_dump(Object(User_model)) #5 [internal function]: krumo::dump(Object(User_model)) #6 /Users/ted/Sites/cnc/application/librarie in /Users/ted/Sites/cnc/sparks/php-activerecord/0.0.2/vendor/php-activerecord/lib/Model.php on line 514
It would be wonderful if I could get these two to work together. Anyone have any ideas?
Just went through description, looks like you can just use xdebug it would nicely color output your regular var_dump;
Looks also like krumo is outdated and unsupported. I would not use such a library
Trying to use the Salesforce SOAP API with PHP. I am getting the following error on attempting to use any of the SForceEnterpriseClient methods.
Error: An Internal Error Has Occurred.
Stack Trace
#0 [internal function]: SoapClient->__call('retrieve', Array)
#1 /path/to/public_html/site/app/Lib/Salesforce/SforceBaseClient.php(835): SoapClient->retrieve(Object(stdClass))
#2 /path/to/public_html/site/app/Model/MyModel.php(28): SforceBaseClient->retrieve('Id, Name', 'Contact', Array)
I do not know how to debug this problem, it is not a very descriptive error. Help would be much appreciated!
I'm using CakePHP 2, in case that's relevant.
Edit - more detail:
SForceEnterpriseClient->login(stuff)
is working fine. No problems there. The error is when I try to use upsert or retrieve (ie actually do anything once I'm logged in).
Enable tracing in the soap client and call the debug methods to get more info
$client = new SoapClient(array('trace' => true, 'exception' => false));
$client->retrieve('stuff');
var_dump($client->__getLastRequest());
var_dump($client->__getLastRequestHeaders());
var_dump($client->__getLastResponse());
var_dump($client->__getLastResponseHeaders());