Witam.
Pytanie wręcz banalne, ale mam problem ze zwróceniem wartości z funkcji.

Fragment pliku wsdl:

Typ bazowy dla innych typów:
  1.            <xsd:complexType name="TreeItemType">
  2.                  <xsd:annotation>
  3.                        <xsd:documentation>
  4.                              Klasy dziedziczące po tej klasie, mogą być
  5.                              traktowane jako drzewko.
  6.                        </xsd:documentation>
  7.                  </xsd:annotation>
  8.                  <xsd:sequence>
  9.                        <xsd:element name="test" type="xsd:string"></xsd:element>
  10.                  </xsd:sequence>
  11.                  <xsd:attribute ref="tns:created" use="optional"></xsd:attribute>
  12.                  <xsd:attribute ref="tns:modified" use="optional"></xsd:attribute>
  13.            </xsd:complexType>


I typ rozszerzający:

  1.            <xsd:complexType name="Article">
  2.                  <xsd:complexContent>
  3.                        <xsd:extension base="tns:TreeItemType">
  4.                              <xsd:sequence>
  5.                                    <xsd:element name="id" type="xsd:int"></xsd:element>
  6.                                    <xsd:element name="parent_id" type="xsd:int"
  7.                                          minOccurs="0">
  8.                                    </xsd:element>
  9.                                    <xsd:element name="name"
  10.                                          type="xsd:string">
  11.                                    </xsd:element>
  12.                              </xsd:sequence>
  13.                        </xsd:extension>
  14.                  </xsd:complexContent>
  15.               </xsd:complexType>


Używam rozszerzenia php, klasy SoapServer i wszystko działa pod warunkiem, że nie używamy dziedziczenia, a używamy bezpośrednio typu Article. Do tej pory zwracałem zwykłą tablicę asocjacyjną, której klucze, to nazwy pól typu Article. Kombinowałem już nawet ze zwracaniem klucza TreeItemType.test, ale program kliencki dostaje za każdym razy pusty ciąg. Dotyczy to wszystkich pól i atrybutów z typu bazowego. Inne pola z typu Article są już zwracane poprawnie! Jakieś pomysły? Dzięki z góry smile.gif

  1. <?php
  2. function GetArticle() {
  3.  return array(
  4.    'id' => 1,
  5.    ...
  6.  );
  7. }
  8. $server = new SoapServer('NewWSDLFile.wsdl');
  9. $server->addFunction(SOAP_FUNCTIONS_ALL);
  10. $server->handle();
  11. ?>


Na prawdę nikt nie wie nic o SoapServer? Na 40 osób tu zaglądających? smile.gif
Atrybuty działają, tylko źle je zadeklarowałem jako referencje, ale pole 'test' dalej nie działa.