[Spce-user] SoapFault exception error
Daniel Tiefnig
dtiefnig at sipwise.com
Tue Nov 20 09:32:37 EST 2012
On 11/15/2012 08:16 PM, Skyler wrote:
> Hi,
Hi!
> This results now in a new error for 2.6
>
> PHP Fatal error: Uncaught exception 'Exception' with message 'No
> value supplied' in
> /home/skyler/wsdl2phpgenerator/lib/phpSource/PhpClass.php:203
The generator chokes on empty values in our enumeration restrictions of
some parameters, like in:
<simpleType name="sst_enable_usrEnum">
<restriction base="xsd:string">
<enumeration value="" />
<enumeration value="no" />
<enumeration value="yes" />
</restriction>
</simpleType>
The XML Schema definition says value is "A set of values from the value
space of the base type definition."[0]. The base type is "string" in
this case, which allows empty values. And even though the XML Schema
definition defines "value space" as "[...] the set of values for a given
datatype. Each value in the value space of a datatype is denoted by one
or more literals in its lexical space"[1], I would assume the "one or
more literals" is a mistake in the specification, as it prohibits empty
values right away.
So if I'm correct, wsdl2phpgenerator should be changed to allow empty
values in enumerations.
Go to addConstant() in lib/phpSource/PhpClass.php and comment out the
"if (strlen($value) == 0)" block at the beginning. If you're lucky,
everything will work fine then.
br,
daniel
[0] http://www.w3.org/TR/xmlschema-2/#rf-enumeration
[1] http://www.w3.org/TR/xmlschema-2/#dt-value-space
More information about the Spce-user
mailing list