|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-10-24 22:44 UTC] toolscom at hotmail dot com
Description:
------------
When trying to connect to a SOAP with php 5.6.17-27 you get a SoapFault exception
Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in SoapClient->__soapCall('getStudentName', Array)
same exact code works fine on PHP 7.0.10
I have broken down the code below into two files.
Test script:
---------------
//[CLIENT]
//client.php
class client{
public function __construct()
{
$params = array(
'location' => 'http://test.local/SOAP/server.php',
'uri' => 'urn://test.local/SOAP/server.php',
'trace' => 1
);
$this->instance = new SoapClient(NULL, $params);
}
public function getName($pram){
return $this->instance->__soapCall('getStudentName', $pram);
}
}
$client = new client();
$id_array = array('id' => '1');
echo $client->getName($id_array);
//[SERVER]
//server.php
class server
{
public function getStudentName($array){
return 'sam';
}
}
$options= array('uri'=>'test.local/SOAP/server.php');
$server=new SoapServer(NULL, $options);
$server->setClass('server');
$server->addFunction('getStudentName');
$server->handle();
Expected result:
----------------
Should echo out "sam" to the screen when you load client.php
Actual result:
--------------
Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in C:\wamp64\www\test\SOAP\client.php:33 Stack trace: #0 C:\wamp64\www\test\SOAP\client.php(33): SoapClient->__soapCall('getStudentName', Array) #1 C:\wamp64\www\test\SOAP\service.php(11): client->getName(Array) #2 {main} thrown in C:\wamp64\www\test\SOAP\client.php on line 33
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 06:00:01 2025 UTC |
[Client] looks like we got no XML document in SoapClient->__soapCall('getStudentName', Array) Are your SOAP Server is also developed in PHP, or will it be in Java / .NET? When there is an error - "looks like we got no XML document", which is highly possible, the SOAP Web Service is implemented in Java /.NET with MTOM enable. PHP 5 does not support MTOM natively.