I'm trying to send test message with my PHP SOAP client. I'm using BeSimpleSoap library because I had problems with standard PHP SOAP calss and NuSOAP class.
Part of the scriptis is:
$client = new BeSimple\SoapClient\SoapClient("GSBService.wsdl", array(
"trace"=>1,
"exceptions"=>1,
'location'=>$SERVICE_TEST,
"local_cert" =>$SOAP_cert,
'uri'=>$NAMESPACE_URI,
"passphrase"=>$cert_password,
"connection_timeout" => 60));
var_dump($client->echo('abc1234'));
print_r( $client->sendMessage($par_envelope));
echo "<p>Request :".htmlspecialchars($client->__getLastRequest()) ."</p>";
echo "<p>Response:".htmlspecialchars($client->__getLastResponse())."</p>";
echo "<p>Debug:".soapDebug($client)."</p>";
Error is:
string(57) "Request: 'abc1234'. Response: '2014-02-12T09:39:56.474Z'."
Fatal error: Uncaught SoapFault exception: [env:Client] Internal Error in C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php:146 Stack trace: #0 C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php(146): SoapClient->__call('sendMessage', Array) #1 C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php(146): BeSimple\SoapClient\SoapClient->sendMessage(Array) #2 {main} thrown in C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php on line 146
I tried:
ini_set('soap.wsdl_cache_enabled',0);
and got this:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from 'file:///schema/GSBSchema.xsd' in C:\xampp\htdocs\NIAS\BeSimpleSoap-master\src\BeSimple\SoapClient\SoapClient.php:113 Stack trace: #0 C:\xampp\htdocs\NIAS\BeSimpleSoap-master\src\BeSimple\SoapClient\SoapClient.php(113): SoapClient->SoapClient('\wsdl_9429a1dff...', Array) #1 C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php(134): BeSimple\SoapClient\SoapClient->__construct('GSBService.wsdl', Array) #2 {main} thrown in C:\xampp\htdocs\NIAS\BeSimpleSoap-master\src\BeSimple\SoapClient\SoapClient.php on line 113
The problem was in encoding of $par_envelope.
After I encoded string in UTF-8 with utf8_encode I didn't get
Fatal error: Uncaught SoapFault exception: [env:Client] Internal Error
Related
i use this PHP Code :
<?php
ini_set("soap.wsdl_cache_enabled", "0");
$AccountShabaCode = "123456789012345678900000";
$WorkTitle = "Example";
$GuildCode = "48160000";
$PardakhtYarTitle = "Xxxa";
$soapclient = new SoapClient('http://87.107.134.111:8021/PardakhtYar.asmx?wsdl');
$add_new_request = $soapclient->AddNewRequest(array('AccountShabaCode' => $AccountShabaCode, 'Password' => $Password, 'WorkTitle' => $WorkTitle, 'GuildCode' => $GuildCode, 'PardakhtYarTitle' => $PardakhtYarTitle));
print_r($add_new_request);
?>
and get this 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 C:\WAMP\home\example.tld\public_html\test.php:11
Stack trace:
#0 C:\WAMP\home\example.tld\public_html\test.php(11): SoapClient->__call('AddNewRequest', Array)
#1 {main}
thrown in C:\WAMP\home\example.tld\public_html\test.php on line 11
How can I fix this error?
i need call "AddNewRequest" ( http://87.107.134.111:8021/PardakhtYar.asmx?op=AddNewRequest )
I am working on TNT SOAP based API, I am using below code but gets only error, I can`t understand what I am doing wrong ?
ini_set("default_socket_timeout",120);
$client = new SoapClient('https://uat.tntexpress.com.au/Webservices/Conservice/ConsignmentService.svc?wsdl');
$params = array(
'payingAccount' => '20003191',
'UserName' => 'NEX-APIT',
'Password' => 'NEX_APIPWT'
);
$response = $client->__soapCall('ProcessConsignmentRequest',$params);
print_r($response);
I am getting this error :
Fatal error: Uncaught SoapFault exception: [s:Client] The creator of this fault did not specify a Reason. in D:\xampp\htdocs\tnt\soap.php:11
Stack trace:
#0 D:\xampp\htdocs\tnt\soap.php(11): SoapClient->__soapCall('ProcessConsignm...', Array)
#1 {main} thrown in D:\xampp\htdocs\tnt\soap.php on line 11
I found here the working code tnt-express
i'm trying to make a test with wsdl , soap and php , and i'm gettin the error :
Fatal error: Uncaught SoapFault exception [wsdl] SOAP-ERROR
I have for now 2 files , one is a given wsdl , and client.php just for test:
<?php
$sClient = 'http://localhost/test/service/wbs.wsdl';
$wsdl = new SoapClient ( '$sClient') ;
echo "test";
?>
and i'm getin this error :
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing
WSDL: Couldn't load from ' hp://localhost/test/service/wbs.wsdl' :
failed to load external entity " hp://localhost/test/service/wbs.wsdl"
in C:\wamp\www\Outbound\client.php:4 Stack trace: #0
C:\wamp\www\test\client.php(4): SoapClient->SoapClient('
hp://localh...') #1 {main} thrown in C:\wamp\www\test\client.php on
line 4
I did change the extension of soap in php.ini , i did all the modification posted in other posts , but nothing works .
$wsdl = new SoapClient ( '$sClient') ;
This would not work. Use:
$wsdl = new SoapClient ( "$sClient") ;
Or - better:
$wsdl = new SoapClient ( $sClient) ;
Try it
$client = new SoapClient("http://{$_SERVER['HTTP_HOST']}/test/service/wbs.wsdl");
I'm trying to upload a torrent into torcache.net, using their SOAP API.
<?php
$client = new SoapClient('http://torcache.net/torcache.wsdl');
$info_hash = $client->cacheTorrent(base64_encode(file_get_contents('test.torrent')));
print_r($info_hash);
?>
Here's what I receive:
Fatal error: Uncaught SoapFault exception: [HTTP] Not Found in D:\Web\data\localweb\test.php:4
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://torcache...', 'urn:xmethods-de...', 1, 0)
#1 D:\Web\data\localweb\test.php(4): SoapClient->__call('cacheTorrent', Array)
#2 D:\Web\data\localweb\test.php(4): SoapClient->cacheTorrent('ZDg6YW5ub3VuY2U...')
#3 {main}
thrown in D:\Web\data\localweb\test.php on line 4
Refer this, see if you can get any help.
or
Try this:
<?php
try {
$x = #new SoapClient("http://torcache.net/torcache.wsdl");
} catch (Exception $e) {
echo $e->getMessage();
}
?>
Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'SimpleXMLElement' is not allowed' in C:\xampp\htdocs\t9l_loyaltyprogram\common\lib\Yii\web\CHttpSession.php:138 Stack trace:
#0 C:\xampp\htdocs\t9l_loyaltyprogram\common\lib\Yii\web\CHttpSession.php(138): session_write_close()
#1 [internal function]: CHttpSession->close()
#2 {main} Next exception 'Exception' with message 'Serialization of 'SimpleXMLElement' is not allowed' in C:\xampp\htdocs\t9l_loyaltyprogram\common\lib\Yii\web\CHttpSession.php:138 Stack trace:
#0 C:\xampp\htdocs\t9l_loyaltyprogram\common\lib\Yii\web\CHttpSession.php(0): session_write_close()
#1 [internal function]: CHttpSession->close()
#2 {main} Next exception 'Exception' with message 'Serialization of 'SimpleXMLElement' is not allowed' in C:\xampp\htdocs\t9l_loyaltyprogram\common\lib\Yii\web\CHttpSession.php:138 Stack trace:
#0 C:\xampp\htdocs\t9l_loyaltyprogram\common\lib\Yii\web\CHttpSession.php(0): session_write_close()
#1 [internal function]: CHttpSession->close()
#2 {ma in C:\xampp\htdocs\t9l_loyaltyprogram\common\lib\Yii\web\CHttpSession.php on line 138
how to fix this issue i'm unable to find any answer
I had the same error. I corrected it using an array of session
foreach ($output['tab_displayId'] as $id_display => $id_param){
$test = new ClParaWidget($id_param, $id_display);
$output[$id_display] = $test->toString($id_display);
if (Yii::app()->session['S' . $id_display] != $output[$id_display])
Yii::app()->session['S' . $id_display] = $output[$id_display];
}
I give more explanation. If I want to save in a session value an array:
Yii::app()->session['data'] = $array_data;
sometimes, this code returns an error:
Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'SimpleXMLElement' is not allowed' in C:\xampp\htdocs\t9l_loyaltyprogram\common\lib\Yii\web\CHttpSession.php:138 Stack trace:
for that, I propose to use a array of session like here:
foreach ($array_data as $id => $data)
Yii::app()->session['S_' . $id] = $data;