Bug #73383 [Com]: SOAP issue

From: Date: Thu, 16 Mar 2017 05:14:38 +0000
Subject: Bug #73383 [Com]: SOAP issue
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207867@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73383&edit=1

 ID:                 73383
 Comment by:         joseph-so at gmx dot net
 Reported by:        toolscom at hotmail dot com
 Summary:            SOAP issue
 Status:             Open
 Type:               Bug
 Package:            SOAP related
 Operating System:   Windows
 PHP Version:        5.6.27
 Block user comment: N
 Private report:     N

 New Comment:

[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.


Previous Comments:
------------------------------------------------------------------------
[2016-10-24 22:44:00] 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


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=73383&edit=1


Thread (3 messages)

« previous php.bugs (#207867) next »