|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49577 Invalid returntype of anyType.
Submitted: 2009-09-17 10:08 UTC Modified: 2009-09-18 10:57 UTC
Avg. Score:4.3 ± 1.1
Reproduced:6 of 6 (100.0%)
Same Version:4 (66.7%)
Same OS:2 (33.3%)
From: kim at datatal dot se Assigned:
Status: Open Package: SOAP related
PHP Version: 5.2.10 OS: Windows
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-09-17 10:08 UTC] kim at datatal dot se
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"/>
<portType name="thePort">
 <operation name="theMethod">
  <output message="typens:theMethodResponse"/>

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 

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-
<theMethodReturn SOAP-ENC:arrayType="xsd:ur-type[2]" xsi:type="SOAP-
<item xsi:type="xsd:string">value</item>
<item xsi:type="xsd:int">1234</item>
</ns1: theMethodResponse>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-18 10:57 UTC] kim at datatal dot se
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:

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.
 [2009-10-28 13:55 UTC] jsd dot bugs dot php dot net at bvac dot co dot za says:
"...the ur-type definition, whose name is anyType in the XML Schema namespace..."

so I believe it is indeed a bug: ur-type is indeed the correct type here, but the _name_ of ur-type is "anyType", and it is the name of the type that belongs in the XML.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 00:01:33 2024 UTC