#35593 [Fbk->Opn]: SOAP Response is incorrect
ID: 35593
User updated by: lixd at dragonsoft dot com dot cn
Reported By: lixd at dragonsoft dot com dot cn
-Status: Feedback
+Status: Open
Bug Type: SOAP related
Operating System: Win2000
PHP Version: 5.0.4
New Comment:
anyone can help me?
Previous Comments:
------------------------------------------------------------------------
[2005-12-08 08:42:02] lixd at dragonsoft dot com dot cn
thanks for you reply. I try it and hope it can work,but I am
disappointed...
------------------------------------------------------------------------
[2005-12-08 08:22:34] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
------------------------------------------------------------------------
[2005-12-08 04:11:25] lixd at dragonsoft dot com dot cn
I am sorry for huge text
you can get full code here
http://218.85.132.173/vnet.rar
or view test.wsdl here
http://218.85.132.173/test.wsdl
------------------------------------------------------------------------
[2005-12-08 03:55:21] lixd at dragonsoft dot com dot cn
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 this bug report at http://bugs.php.net/?id=35593&edit=1
Thread (9 messages)