PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Web Services » SOAP » Bug #8551

incorect mapping of function for wsdl generator

Details

Submitted2006-08-24 14:32 UTC
Frommarek dot nos at centrum dot cz
Assignedyunosh
StatusClosed
PackageSOAP
PHP Version5.1.4
OSlinux
Roadmaps(Not assigned)

Comments

[2006-08-24 14:32 UTC] marek dot nos at centrum dot cz

Description:
------------
Even I map a function using addToMap() method I'm not giving correct WSDL.

addToMap() fills the dispatch_map array of the SOAP_Server object.

But if I look at the Disco.php:157-158 I see a workaround which uses class $server which isn't defined. I suggest there should be $this->soap_server instead.

Test script:
---------------
<?
require_once('SOAP/Server.php');

function foo($param1, $param2) {
return $param1 + $param2;
}

$server = new SOAP_Server;
$server->_auto_translation = true;

$server->addToMap('foo', Array('test' => 'string', 'param1' => 'int', 'param2' => 'int'), Array('data' => 'int'));
//$server->service($HTTP_RAW_POST_DATA);

//init
require_once('SOAP/Disco.php');
$disco = new SOAP_DISCO_Server($server, 'namespace');

//vypise
header("Content-type: text/xml");
echo $disco->getWSDL();

Expected result:
----------------
<?xml version="1.0" ?>
- <definitions name="namespace" targetNamespace="urn:namespace" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types xmlns="http://schemas.xmlsoap.org/wsdl/" />
- <message name="fooRequest">
<part name="test" type="xsd:string" />
<part name="param1" type="xsd:int" />
<part name="param2" type="xsd:int" />
</message>
- <message name="fooResponse">
<part name="data" type="xsd:int" />
</message>
- <portType name="namespacePort">
- <operation name="foo">
<input message="tns:fooRequest" />
<output message="tns:fooResponse" />
</operation>
</portType>
- <binding name="namespaceBinding" type="tns:namespacePort">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
- <operation name="foo">
<soap:operation soapAction="#foo" />
- <input>
<soap:body use="encoded" namespace="" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
- <output>
<soap:body use="encoded" namespace="" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
</binding>
- <service name="namespaceService">
<documentation />
- <port name="namespacePort" binding="tns:namespaceBinding">
<soap:address location="http://192.168.2.249:81/rpc/addtomap_bug.php" />
</port>
</service>
</definitions>

Actual result:
--------------
<?xml version="1.0" ?>
- <definitions name="namespace" targetNamespace="urn:namespace" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types xmlns="http://schemas.xmlsoap.org/wsdl/" />
<portType name="namespacePort" />
- <binding name="namespaceBinding" type="tns:namespacePort">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
</binding>
- <service name="namespaceService">
<documentation />
- <port name="namespacePort" binding="tns:namespaceBinding">
<soap:address location="http://192.168.2.249:81/rpc/addtomap_bug.php" />
</port>
</service>
</definitions>