php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73383 SOAP issue
Submitted: 2016-10-24 22:44 UTC Modified: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: toolscom at hotmail dot com Assigned:
Status: Open Package: SOAP related
PHP Version: 5.6.27 OS: Windows
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-16 05:14 UTC] joseph-so at gmx dot net
[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.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Sep 16 14:01:28 2019 UTC