#40448 [Opn->Fbk]: SOAP Server Extension - Fails with SOAP1.1 compliant envelope
| From: | dmitry@php.net | Date: | Thu, 15 Feb 2007 14:57:15 +0000 |
| Subject: | #40448 [Opn->Fbk]: SOAP Server Extension - Fails with SOAP1.1 compliant envelope | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-108978@lists.php.net to get a copy of this message | ||
ID: 40448
Updated by: dmitry@php.net
Reported By: dreddy at duke-energy dot com
-Status: Open
+Status: Feedback
Bug Type: SOAP related
Operating System: AIX 5.3
PHP Version: 5.2.1
Assigned To: dmitry
New Comment:
<?php
$HTTP_RAW_POST_DATA = <<<EOF
<SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body xmlns:ns1="urn:myquote">
<ns1:getQuote>
<symbol>ibm</symbol>
</ns1:getQuote>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EOF;
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");
$server->setClass("QuoteService");
$server->handle();
?>
$ sapi/cli/php ../../test/40448/bug40448.php
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
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.
Previous Comments:
------------------------------------------------------------------------
[2007-02-15 14:20:37] 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 provided...it 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 12:48:12] dmitry@php.net
You probably posted the wrong Envelope in the first message. It works
fine.
------------------------------------------------------------------------
[2007-02-12 15:04:23] dreddy at duke-energy dot com
<operation name="getQuote">
<documentation>
Test Function
</documentation>
<input message="typens:getQuote"/>
<output message="typens:getQuoteResponse"/>
</operation>
</portType>
<binding name="QuoteServiceBinding"
type="typens:QuoteServicePortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getQuote">
<soap:operation soapAction="urn:QuoteServiceAction"/>
<input>
<soap:body namespace="urn:myquote" use="literal"/>
</input>
<output>
<soap:body namespace="urn:myquote" use="literal"/>
</output>
</operation>
</binding>
<service name="myquoteService">
<port name="QuoteServicePort" binding="typens:QuoteServiceBinding">
<soap:address location="http://weirsz/soap_server.php"/>
</port>
</service>
</definitions>
------------------------------------------------------------------------
[2007-02-12 15:04:17] 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="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<message name="getQuote">
<part name="symbol" type="xsd:string"/>
</message>
<message name="getQuoteResponse">
<part name="getQuoteReturn" type="xsd:string"/>
</message>
<portType name="QuoteServicePortType">
<documentation>
Testing SOAP Server Extension
</documentation>
------------------------------------------------------------------------
[2007-02-12 15:03:09] dreddy at duke-energy dot com
The soap server:
<?php
/**
* 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];
}
else
{
throw new SoapFault("Server","Unknow Symbol '$symbol'.");
}
}
}
ini_set("soap.wsdl_cache_enabled", "0");
$server = new SoapServer("testsoap.wsdl");
$server->setClass("QuoteService");
$server->handle();
?>
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/40448
--
Edit this bug report at http://bugs.php.net/?id=40448&edit=1