cnemelka
cnemelka

Reputation: 3

Zend Framework Soap WSDL

I have a working SOAP service that uses PHP/Zend Framework SOAP. The problem I am having is the WSDL needs to implement "xsd:decimal" instead of "xsd:int".

Using the AutoDiscovery method on the following snippet:

/* @var decimal */
public $prize;

returns the following error:

Cannot add a complex type decimal that is not an object or where class could not be found in 'DefaultComplexType' strategy.

Using a class map doesn't seem to fix the issue. Is there any way to use "xsd:decimal" with the AutoDiscovery method?

The following snippet works fine, but shows "xsd:int" in the WSDL:

/* @var int */
public $prize

Upvotes: 0

Views: 1600

Answers (2)

Alberto Arena
Alberto Arena

Reputation: 343

You can't use decimal.

But have you tried using a complex type named decimal, that maps to a float?

class decimal
{
/** @var float */
public $prize;
}

You need also to define the correct autodiscover strategy:

$autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');

Upvotes: 0

Anil Shinde
Anil Shinde

Reputation: 331

use float

PHP floats and doubles <-> xsd:float.

Upvotes: 1

Related Questions