#35593 [NEW]: SOAP Response is incorrect
| From: | lixd at dragonsoft dot com dot cn | Date: | Thu, 08 Dec 2005 02:55:23 +0000 |
| Subject: | #35593 [NEW]: SOAP Response is incorrect | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-89922@lists.php.net to get a copy of this message | ||
From: lixd at dragonsoft dot com dot cn
Operating system: Win2000
PHP version: 5.1.1
PHP Bug Type: SOAP related
Bug description: SOAP Response is incorrect
Description:
------------
In win2000\apache 2.0.53\php5.0.4,I wrote some code for test.wsdl(I can't
modify it, for some reason),and test by
http://192.168.0.228/vnet/client.php,but I
can't get result in
expectation.
Reproduce code:
---------------
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://192.168.0.228/vnet/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://192.168.0.228/vnet/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified"
targetNamespace="http://192.168.0.228/vnet/">
<s:element name="Grant">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="APID"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="Authenticator"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="TimeStamp"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GrantResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1"
name="GrantResult"
type="tns:GrantResult" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="GrantResult">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="APID"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1"
name="Authenticator"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="TimeStamp"
type="s:string" />
</s:sequence>
</s:complexType>
</s:schema>
</wsdl:types>
<wsdl:message name="GrantSoapIn">
<wsdl:part name="parameters" element="tns:Grant" />
</wsdl:message>
<wsdl:message name="GrantSoapOut">
<wsdl:part name="parameters" element="tns:GrantResponse" />
</wsdl:message>
<wsdl:portType name="TestSoap">
<wsdl:operation name="Grant">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Grant
Interface</documentation>
<wsdl:input message="tns:GrantSoapIn" />
<wsdl:output message="tns:GrantSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TestSoap" type="tns:TestSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<wsdl:operation name="Grant">
<soap:operation soapAction="http://192.168.0.228/vnet/Grant"
style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Test">
<documentation
xmlns="http://schemas.xmlsoap.org/wsdl/">Description</documentation>
<wsdl:port name="TestSoap" binding="tns:TestSoap">
<soap:address location="http://192.168.0.228/vnet/server.php"
/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
<?php
//server.php
class GrantResult{
public $APID;
}
function Grant($req){
$res = new GrantResult();
$res->APID = $req->APID;
return $res;
}
$server = new SoapServer("test.wsdl", array('soap_version' => SOAP_1_1));
$server->addFunction("Grant");
$server->handle();
?>
<?php
//client.php
header("content-type:text/html;charset=utf-8");
class GrantRequest{
public $APID = "14000019";
}
try {
$opts = array('trace' => 1, 'exceptions' =>
0,'soap_version' =>
SOAP_1_1);
$client = new SoapClient("test.wsdl", $opts);
$req = new GrantRequest();
$data = $client->Grant($req);
print "RequestHeader
:<hr>\n".htmlspecialchars($client->__getLastRequestHeaders())
."<hr>\n";
print "Request :<hr>\n".htmlspecialchars($client->__getLastRequest())
."<hr>\n";
print "ResponseHeader
:<hr>\n".htmlspecialchars($client->__getLastResponseHeaders())
."<hr>\n";
print
"Response:<hr>\n".htmlspecialchars($client->__getLastResponse())."\n";
}
catch (SOAPFault $e) {
print "<hr>Error<hr>";
print $e;
}
Expected result:
----------------
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://192.168.0.228/vnet/">
<SOAP-ENV:Body>
<ns1:GrantResponse>
<ns1:GrantResult>
<ns1:APID>14000019</ns1:APID>
</ns1:GrantResult>
</ns1:GrantResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Actual result:
--------------
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://192.168.0.228/vnet/">
<SOAP-ENV:Body>
<ns1:GrantResponse />
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--
Edit bug report at http://bugs.php.net/?id=35593&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35593&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35593&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35593&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35593&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35593&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35593&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35593&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35593&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35593&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35593&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35593&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35593&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35593&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35593&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35593&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35593&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35593&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35593&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35593&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35593&r=mysqlcfg