We have wsdl :
http://xxxxxxxxxxxxxxx.com/XXXX_Beta_3_API/webservice.asmx?wsdl
IN PHP FILE : i have created a Class with some arrays in it..
class Crmtet {
public $abc;
public $abc2;
public $abc3;
public $abc4;
}
$client = new SoapClient(http://xxxxxxxxxxxxxxx.com/XXXX_Beta_3_API/webservice.asmx?wsdl);
$obj = new Crmtet();
$obj->abc= "Test";
$obj->abc2= "Test2";
$obj->abc3= "Test3";
$obj->abc4= "Test4";
$result = $client->CRM_Warehouse_Master_Insert($obj)->CRM_Warehouse_Master_InsertResult;
echo"re".$result;
But i am getting below error :
Fatal error: Uncaught SoapFault exception: [soap:Server] Server was
unable to process request. ---> Object reference not set to an
instance of an object. in
E:\EasyPHP-12.1\www\test\inserwarrecrm.php:60 Stack trace: #0
E:\EasyPHP-12.1\www\test\inserwarrecrm.php(60):
SoapClient->__call('CRM_Warehouse_M...', Array) #1
E:\EasyPHP-12.1\www\test\inserwarrecrm.php(60):
SoapClient->CRM_Warehouse_Master_Insert(Object(Crmtet)) #2 {main}
thrown in E:\EasyPHP-12.1\www\test\inserwarrecrm.php on line 60
What is the issue.. can anyone help..??
Related
My webpage gives the "methods with the same name as their class will not be constructors in a future version of php" error with the below code.
When I change the "function settings()" to "function __construct()", the web page gives a fatal error.
Fatal error: Uncaught Error: Call to undefined method validator::settings() in /home/mertcek1563/public_html/rmd2015/sdwf/validator.php:11
Stack trace:
#0 /home/mertcek1563/public_html/rmd2015/z_common.php(103): validator->__construct()
#1 /home/mertcek1563/public_html/rmd2015/z_core.php(22): include('/home/mertcek15...')
#2 /home/mertcek1563/public_html/rmd2015/index.php(2): include('/home/mertcek15...')
#3 {main}
thrown in /home/mertcek1563/public_html/rmd2015/sdwf/validator.php on line 11
How I can fix this code?
class settings
{
var $settings = array();
function settings(){
$this->settings["price"]=array();
$this->settings["price"]["dot"]=".";
$this->settings["price"]["decimals"]=6;
$this->settings["date"]=array();
$this->settings["date"]["delimiter"]="/";
$this->settings["date"]["format"]="dd/mm/yyyy";
$this->settings["number"]=array();
$this->settings["number"]["dot"]=".";
$this->settings["number"]["decimals"]=6;
}
}
Then I end up with fatal error:
Fatal error: Uncaught Error: Call to undefined method
validator::settings() in
/home/mertcek1563/public_html/rmd2015/sdwf/validator.php:11
<?
include_once("settings.php");
class validator extends settings
{
var $errors = array();
var $required = array();
function __construct(){
$this->settings();
}
I have a issue trying to save an object into session.
From my index.php I create the object and store it into session:
include_once __DIR__.'/vendor/autoload.php';
use Axiom\Rivescript\Rivescript;
$test = new Rivescript();
$test->load(realpath(__KNOWLEDGE__));
session_start();
if (isset($_SESSION['ENGINE'])){
unset($_SESSION['ENGINE']);
}
$_SESSION['ENGINE'] = $test;
in another php page I recall the session to get te object:
session_start();
if (!isset($_SESSION['ENGINE'] )){
// error
}else{
$test = $_SESSION['ENGINE'];
$txt = $test->reply($input,$client_id);
}
This page is called by AJAX.
and I get this error:
Notice: Trying to get property 'memory' of non-object in /var/www/html/vendor/axiom/rivescript/src/Cortex/Input.php on line 64
Fatal error: Uncaught Error: Call to a member function substitute() on null in /var/www/html/vendor/axiom/rivescript/src/Cortex/Input.php:64 Stack trace: #0 /var/www/html/vendor/axiom/rivescript/src/Cortex/Input.php(33): Axiom\Rivescript\Cortex\Input->cleanOriginalSource() #1 /var/www/html/vendor/axiom/rivescript/src/Rivescript.php(34): Axiom\Rivescript\Cortex\Input->__construct('ciao', '5e5fe0688782a') #2 /var/www/html/include/bot.php(24): Axiom\Rivescript\Rivescript->reply('ciao', '5e5fe0688782a') #3 {main} thrown in /var/www/html/vendor/axiom/rivescript/src/Cortex/Input.php on line 64
Any help ??
I am getting the following error when trying to create a new SoapClient.
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://api.mindbodyonline.com/0_5/ClassService.asmx?wsdl' : failed to load external entity "https://api.mindbodyonline.com/0_5/ClassService.asmx?wsdl" in C:\xampp\htdocs\Work\Ice\default\soaptest.php:8 Stack trace: #0 C:\xampp\htdocs\Work\Ice\default\soaptest.php(8): SoapClient->SoapClient('https://api.min...') #1 {main} thrown in C:\xampp\htdocs\Work\Ice\default\soaptest.php on line 8
what would cause the WSDL to not load?
Enable openssl in your php.ini you load the WSDL over https this is only working when the openssl module is enabled.
Not sure if this might be the case with you but if you are using the PHP classes provided on the Minbody API on Github, note that they have recently updated them. I had the same problem with classService.php. If you are using classService.php, update the constructor function to the following (same will apply to other services):
function __construct($debug = false)
{
$endpointUrl = "https://" . GetApiHostname() . "/0_5/ClassService.asmx";
$wsdlUrl = $endpointUrl . "?wsdl";
$this->debug = $debug;
$option = array();
if ($debug)
{
$option = array('trace'=>1);
}
$this->client = new soapclient($wsdlUrl, $option);
$this->client->__setLocation($endpointUrl);
}
$param['websiteConfigID'] = 729872;
$param['numberOfRecords'] = 10;
$param['numberOfRecords'] = 10;
$client = new SoapClient(WSDL);
$result = $client->__soapCall('GetTicketsStringInputs', array('parameters' => $param));
$result holding this error message....
Fatal error: Uncaught SoapFault exception:
[Client] Function ("GetTicketsStringInputs") is not a valid method for this service in /home/fmticket/public_html/inc/genericLib.php:279
Stack trace:
#0 /home/fmticket/public_html/inc/genericLib.php(279): SoapClient->__soapCall('GetTicketsStrin...', Array)
#1 /home/fmticket/public_html/resultsTicket.php(12): getTickets(Array)
#2 {main} thrown in /home/fmticket/public_html/inc/genericLib.php on line 279
how to resolve it?? plz help.
Your code is calling the remote GetTicketsStringInputs function :
$client->__soapCall('GetTicketsStringInputs', ...
The Fatal error you get indicates :
Function ("GetTicketsStringInputs") is not a valid method for this service
It seems pretty clear : the method you're trying to call doesn't exist, it is not provided by the remote web-service.
So, to fix that Fatal Error, you have to stop calling that function ;-)
You should check the WSDL of your webservice : does it really export such a method ?
Something very strange.
WSDL file generates fine. Here is source simple class
class SoapTest
{
/**
* Prapapapapapapap
* #return string Bls bls
*/
public function getList()
{
return "code";
}
}
Code for WSDL, Server, Client
if (isset($_REQUEST['wsdl'])) {
$ad = new Zend_Soap_AutoDiscover();
$ad->setClass('SoapTest');
$ad->handle();
} else if ( isset($_REQUEST['client']) ) {
$client = new Zend_Soap_Client("http://localhost/test.php");
echo $client->getList();
}
else {
$server = new Zend_Soap_Server("http://localhost/test.php?wsdl");
$server->setClass('SoapTest');
$server->handle();
}
Autogenerated WSDL have some problems with SoapServer
Uncaught exception 'Zend_Soap_Server_Exception' with message 'Invalid XML' in Z:\home\localhost\www\Zend\Soap\Server.php:694 Stack trace: #0 Z:\home\localhost\www\Zend\Soap\Server.php(817): Zend_Soap_Server->_setRequest('') #1 Z:\home\localhost\www\test.php(54): Zend_Soap_Server->handle() #2 {main} thrown in Z:\home\localhost\www\Zend\Soap\Server.php on line 694
I just don't understand why? There is no extra symbol in WSDL like space or \n, all headers are specified.
Php 5.2.12
ZF 1.10.0
all problems from eAccelerator