I'd like to suggest using the Zend_Soap_Server in wsdl mode with
class-mapping to accomplish what you want to do. Create the wsdl manually
(not fun) or with something like Zend Studio's wsdl editor. Then map those
classes to the corresponding complex types in the wsdl. A couple class
declarations are listed below.
The sequence of GradeTypes in the StudentType will be represented as an
array of Grade objects in the grade() member variable when the soap server
returns it to your application code.
The class-map option to the Zend_Soap_Server's constructor would look like:
'classmap' => array('StudentType' => 'Student', 'GradeType' => 'Grade')
Hope this helps. Regards,
-FW
class Grade
{
/**
* Graded Item ID
*
* @var string
*/
public $gid;
/**
* Time Modified
*
* @var datetime
*/
public $effdate;
/**
* Grade - element value
*
* @var string
*/
public $_;
/**
* Grade class constructor
*
* @param string $gid
* @param string $effdate
* @param string $value
*/
public function __construct($gid = null, $effdate = null, $value = null)
{
$this->gid = $gid;
$this->effdate = $effdate;
$this->_ = $value;
}
}
/**
* Student class - (SOAP) Used as a data container that will be serialized
back to consumer as a student element.
* Associated to the WSDL using a classmap.
*/
class Student
{
/**
* Student ID
*
* @var string
*/
public $sid;
/**
* Student Name
*
* @var string
*/
public $name;
/**
* Grade - element value
*
* @var Grade()
*/
public $grade;
/**
* Student class constructor
*
* @param string $sid
* @param string $name
*/
public function __construct($sid = null, $name = null)
{
$this->sid = $sid;
$this->name = $name;
$this->grade = array();
}
}
Fragments of the wsdl:
<xsd:complexType name="GradeType">
<xsd:simpleContent>
<xsd:extension base="xsd:float">
<xsd:attribute name="gid" type="xsd:string"
use="required">
</xsd:attribute>
<xsd:attribute name="effdate"
type="xsd:dateTime" use="required">
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="StudentType">
<xsd:sequence>
<xsd:element name="grade" type="tns:GradeType"
minOccurs="0" maxOccurs="unbounded">
</xsd:element>
</xsd:sequence>
<xsd:attribute name="sid" type="xsd:string"
use="required">
</xsd:attribute>
<xsd:attribute name="name" type="xsd:string"
use="required">
</xsd:attribute>
</xsd:complexType>
Jan Pieper wrote:
>
> Hi guys,
>
> I set up an soap service with Zend_Soap_Server and WSDL generation via
> Zend_Soap_AutoDiscover and it should be used via Microsoft Dynamics AX.
> But it
> seems that it cannot handle "soap-enc:Array" datatype.
>
> Detail: Beim Ausführen einer WSDL-Importerweiterung wurde eine Ausnahme
> ausgelöst:
> System.ServiceModel.Description.XmlSerializerMessageContractImporter
> Fehler: Der Datentyp 'http://schemas.xmlsoap.org/soap/encoding/:Array' ist
> nicht
> vorhanden.
>
> Sorry for the german error message but it says something like "exception
> [exceptionName] occured" and "datatype [url] is not available".
>
> Any clue how to get it working?
>
> -- Jan
>
>
--
View this message in context:
http://www.nabble.com/Microsoft-Dynamics-AX-vs.-soap-enc%3AArray-tp20618684p20622942.html
Sent from the Zend Framework mailing list archive at Nabble.com.