#49577 [Fbk->Opn]: Invalid returntype of anyType.
| From: | kim at datatal dot se | Date: | Fri, 18 Sep 2009 10:57:47 +0000 |
| Subject: | #49577 [Fbk->Opn]: Invalid returntype of anyType. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-142506@lists.php.net to get a copy of this message | ||
ID: 49577
User updated by: kim at datatal dot se
Reported By: kim at datatal dot se
-Status: Feedback
+Status: Open
Bug Type: SOAP related
Operating System: Windows
PHP Version: 5.2.10
New Comment:
Tried latest 5.2 snapshot, still the same result.
If you look in php_encoding.c:2392 you will see that "xsd:anyType" is
written as "xsd:ur-type".
If you see the specification for SOAP 1.1 you will note that arrays
have ur-type as the data-type for arrays:
http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383522
So this seems like a no-bug, except that XML Schema specification
dictates that ur-type is only an abstract type and not part
of the public XML document specification. That leads to validation of
SOAP responses with ur-type failing.
I'm not sure if this "bug" can be handled/fixed in PHP-SOAP or if its
only a problem with the SOAP specification, or some
other unknown reason for this being a problem.
Previous Comments:
------------------------------------------------------------------------
[2009-09-17 15:42:12] jani@php.net
Please try using this snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[2009-09-17 10:08:00] kim at datatal dot se
Description:
------------
Returning from a method invoked over SOAP RPC with a datatype of
anyType
to a .NET client application will generate an error when the datatype
in
PHP is an array with values of different types.
As specified in the XML Schema document there something known as
anyType
which is a close approximation to the urType/ur-type.
Validation fails in the .NET client due to SOAP returning a datatype of
ur-type and not anyType.
It works when all the values in the array is of the same type, since
the
array will become of the type of the values instead of a
generic/abstract type.
Reproduce code:
---------------
Create a web service with the following in the WSDL:
<message name="theMethodResponse">
<part name="theMethodReturn" type="xsd:anyType"/>
</message>
<portType name="thePort">
<operation name="theMethod">
<output message="typens:theMethodResponse"/>
</operation>
</portType>
In the SOAP service implementation:
public function theMethod()
{
return array("value", 1234);
}
Expected result:
----------------
The expected result returned from the method in C# is a type of
object[].
Actual result:
--------------
An exception specifying that 'ur-type' is not defined in the XML
schema in the following response:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns1="urn:smsservice"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">;
<SOAP-ENV:Body>
<ns1:theMethodResponse>
<theMethodReturn SOAP-ENC:arrayType="xsd:ur-type[2]" xsi:type="SOAP-
ENC:Array">
<item xsi:type="xsd:string">value</item>
<item xsi:type="xsd:int">1234</item>
</theMethodReturn>
</ns1: theMethodResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49577&edit=1