php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40649 Void Soap function can't return SegFault
Submitted: 2007-02-26 19:19 UTC Modified: 2007-03-02 09:51 UTC
From: jdespatis at yahoo dot fr Assigned: dmitry (profile)
Status: Not a bug Package: SOAP related
PHP Version: 5.2.1 OS: Linux 2.6.18 Debian
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jdespatis at yahoo dot fr
New email:
PHP Version: OS:

 

 [2007-02-26 19:19 UTC] jdespatis at yahoo dot fr
Description:
------------
I have a client and server soap which worked with php 5.1.2, but whenever i upgrade to php > 5.1.2, this code doesn't work anymore.

It's a simple client and server soap.

After debugging, the problem comes from the fact that if no <message name="funcResponse"> is provided to a function to explain the output, then this function always sends null

Even if the function throws an exception

It seems that php <= 5.1.2 was adding a default output function so that exceptions could be throwed

Reproduce code:
---------------
When using the simple client :
http://www.despatis.com/client.phps

with the simple soap server:
http://www.despatis.com/soap_server.phps

and with the wsdl:
http://www.despatis.com/Webservices.wsdl

(to make the code work, the good wsdl to use is:http://www.despatis.com/Webservices2.wsdl, however this code should work with a minimal Webservices.wsdl, that doesn't provide information on output function as the function is a void function !)

Expected result:
----------------
client.php should print:

Request :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:xmethods" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:setSerial><serial xsi:type="xsd:string">pif</serial><version xsi:type="xsd:string">puf</version></ns1:setSerial></SOAP-ENV:Body></SOAP-ENV:Envelope>

Response:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Exception throwed</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>


Actual result:
--------------
Actual result is:

Request :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:xmethods" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:setSerial><serial xsi:type="xsd:string">pif</serial><version xsi:type="xsd:string">puf</version></ns1:setSerial></SOAP-ENV:Body></SOAP-ENV:Envelope>

Response:



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-26 19:24 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2007-02-26 19:49 UTC] jdespatis at yahoo dot fr
Exactly the same problem with the last last php snapshot you provide.

But this bug is quite old, i've detected in php 5.1.3 and upper

(i sticked to php5.1.2 to avoid this bug, but now i need to use php5.2)
 [2007-03-02 09:51 UTC] dmitry@php.net
This is not a bug. SOAP client must not wait for response from one-way operation. BTW ext/soap has an option to change this behavior.
The following code works as you expected. 

<?php
  ini_set('soap.wsdl_cache_enabled', false);
  $client = new SoapClient(dirname(__FILE__).'/bug40649.wsdl',array(
    "trace"      => 1,
    "exceptions" => 0,
    "features"   => SOAP_WAIT_ONE_WAY_CALLS
    ));
  $ret = $client->setSerial("pif", "puf");

  print "<pre>\n";
  print "Request :\n".$client->__getLastRequest() ."\n";
  print "Response:\n".$client->__getLastResponse()."\n";
  print "</pre>";
?>


 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri May 24 01:01:26 2019 UTC