|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40448 SOAP Server Extension - Fails with SOAP1.1 compliant envelope
Submitted: 2007-02-12 14:43 UTC Modified: 2007-02-15 15:05 UTC
From: dreddy at duke-energy dot com Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5.2.1 OS: AIX 5.3
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.
Block user comment
Status: Assign to:
Bug Type:
From: dreddy at duke-energy dot com
New email:
PHP Version: OS:


 [2007-02-12 14:43 UTC] dreddy at duke-energy dot com
We are using PHP version 5.1.6 (not in the drop down for bugs)

Testing Flash8 Webservice Component connecting to a PHP5 SOAP Extension soap server, and the Apache listener will generate an internal server error (500).

Problem appears to be libsoap not handling what appears to be a valid SOAP1.1 envelope, even if the the soap server is defined to be SOAP1.1.

The workaround for us, is to use NuSoap, which is a SOAP 1.1 implementation.

Reproduce code:
The problem is the additional element on the BODY tab, legit in SOAP1.1 but not in SOAP1.2

<SOAP-ENV:Envelope xmlns:xsi="" xmlns:xsd="" xmlns:SOAP-ENV=""><SOAP-ENV:Body xmlns:ns1="urn


...and look for a section titled, "6. Changes Between SOAP 1.1 and SOAP 1.2"

The first item under additional or changed syntax:

SOAP 1.2 does not permit any element after the body. The SOAP 1.1 schema definition allowed for such a possibility, but the textual description is silent about it. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-12 14:52 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

 [2007-02-12 15:03 UTC] dreddy at duke-energy dot com
The soap server:

 * Testing SOAP Server Extension 
 * @author dreddy 
 * @package defaultPackage 
class QuoteService { 
    private $quotes = array("ibm" => 90, "se"=>20); 
 * Test Function 
 * @param string $symbol 
 * @return string 
    function getQuote($symbol) 
        if (isset($this->quotes[$symbol])) 
            return $this->quotes[$symbol]; 
            throw new SoapFault("Server","Unknow Symbol '$symbol'."); 

ini_set("soap.wsdl_cache_enabled", "0"); 
$server = new SoapServer("testsoap.wsdl"); 
 [2007-02-12 15:04 UTC] dreddy at duke-energy dot com
<?xml version='1.0' encoding='UTF-8'?>
<!-- WSDL file generated by Zend Studio. -->
<definitions name="myquote" targetNamespace="urn:myquote" xmlns:typens="urn:myquote" xmlns:xsd="" xmlns:soap="" xmlns:soapenc="" xmlns:wsdl="" xmlns="">
<message name="getQuote">
<part name="symbol" type="xsd:string"/>
<message name="getQuoteResponse">
<part name="getQuoteReturn" type="xsd:string"/>
<portType name="QuoteServicePortType">
Testing SOAP Server Extension
 [2007-02-12 15:04 UTC] dreddy at duke-energy dot com
<operation name="getQuote">
Test Function
<input message="typens:getQuote"/>
<output message="typens:getQuoteResponse"/>
<binding name="QuoteServiceBinding" type="typens:QuoteServicePortType">
<soap:binding style="rpc" transport=""/>
<operation name="getQuote">
<soap:operation soapAction="urn:QuoteServiceAction"/>
<soap:body namespace="urn:myquote" use="literal"/>
<soap:body namespace="urn:myquote" use="literal"/>
<service name="myquoteService">
<port name="QuoteServicePort" binding="typens:QuoteServiceBinding">
<soap:address location="http://weirsz/soap_server.php"/>
 [2007-02-15 12:48 UTC]
You probably posted the wrong Envelope in the first message. It works fine.
 [2007-02-15 14:20 UTC] dreddy at duke-energy dot com
No it doesn't work, the SOAP envelope to use is as given.  If you testing a PHP-client to a PHP-server it works, but try putting the PHP-server (soap) into SOAP_1_1 mode, and send it the 1.1 compliant envelope as I have will not work.

If you are testing with a PHP client, you will have to fudge things by overlaying HTTP_RAW_POST_DATA with the 1.1 envelope.
 [2007-02-15 14:57 UTC]
<SOAP-ENV:Envelope xmlns:xsi=""
<SOAP-ENV:Body xmlns:ns1="urn:myquote">

class QuoteService { 
    private $quotes = array("ibm" => 90, "se"=>20); 
    function getQuote($symbol) 
        if (isset($this->quotes[$symbol])) { 
            return $this->quotes[$symbol]; 
        } else { 
            throw new SoapFault("Server","Unknow Symbol '$symbol'."); 

ini_set("soap.wsdl_cache_enabled", "0"); 
$server = new SoapServer(dirname(__FILE__)."/bug40448.wsdl"); 

$ sapi/cli/php ../../test/40448/bug40448.php
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns1="urn:myquote"><SOAP-ENV:Body><ns1:getQuoteResponse><getQuoteReturn>90</getQuoteReturn></ns1:getQuoteResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

Works fine. If you mean another envelope then please provide it.

 [2007-02-15 15:05 UTC] dreddy at duke-energy dot com
You are correct!  I am baffled, but happy to eat my words on this one.

Went back and tried the test case again this AM, and the server no longer kicked an internal server error and processed the request.

I worked with Zend support for a couple weeks on this one and neither one of us could get this to work, as libsoap is not their extension I filed a bug report here.

I will close this bug...with some measure of humility.  Thanks...and I apologize for wasting your time.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 22:01:32 2024 UTC