Mehrer Fehler in XSDs

61 views
Skip to first unread message

Richard Neumann

unread,
May 21, 2014, 11:57:53 AM5/21/14
to immobilienscou...@googlegroups.com
Hallo zusammen,

neben dem bereits hier angesprochenen Problem bin ich nun auf ein zweites gestoßen.
Bei der Abfrage der RealEstates meines Testbenutzers bekomme ich folgende Liste von der RestAPI zurück

<realestates:realEstates xmlns:ns2="http://rest.immobilienscout24.de/schema/platform/gis/1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:common="http://rest.immobilienscout24.de/schema/common/1.0" xmlns:realestates="http://rest.immobilienscout24.de/schema/offer/realestates/1.0">
   
<Paging>
       
<pageNumber>1</pageNumber>
       
<pageSize>20</pageSize>
       
<numberOfPages>1</numberOfPages>
       
<numberOfHits>1</numberOfHits>
   
</Paging>
   
<realEstateList>
       
<realEstateElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:offerlistelement="http://rest.immobilienscout24.de/schema/offer/listelement/1.0" xsi:type="offerlistelement:OfferApartmentRent" xlink:href="http://rest.sandbox-immobilienscout24.de/restapi/api/offer/v1.0/user/homeinfo.de/realestate/62409484" modification="2014-04-24T13:54:13.000+02:00" creation="2014-04-07T13:35:33.000+02:00" id="62409484">
           
<externalId>1</externalId>
           
<title>Testanzeige</title>
           
<address>
               
<street>Melanchthtonstraße</street>
               
<houseNumber>7</houseNumber>
               
<postcode>30165</postcode>
               
<city>Hannover</city>
               
<geoHierarchy>
                   
<continent>
                       
<geoCodeId>1</geoCodeId>
                       
<fullGeoCodeId>1</fullGeoCodeId>
                   
</continent>
                   
<country>
                       
<geoCodeId>276</geoCodeId>
                       
<fullGeoCodeId>1276</fullGeoCodeId>
                   
</country>
                   
<region>
                       
<geoCodeId>9</geoCodeId>
                       
<fullGeoCodeId>1276009</fullGeoCodeId>
                   
</region>
                   
<city>
                       
<geoCodeId>17</geoCodeId>
                       
<fullGeoCodeId>1276009017</fullGeoCodeId>
                   
</city>
                   
<quarter>
                       
<geoCodeId>60</geoCodeId>
                       
<fullGeoCodeId>1276009017060</fullGeoCodeId>
                   
</quarter>
                   
<neighbourhood>
                       
<geoCodeId>3241001000215</geoCodeId>
                   
</neighbourhood>
               
</geoHierarchy>
           
</address>
           
<realEstateState>ACTIVE</realEstateState>
           
<common:publishChannels>
               
<publishChannel id="10000" title="Immobilienscout24"/>
           
</common:publishChannels>
           
<price>
               
<value>100</value>
               
<currency>EUR</currency>
           
</price>
           
<livingSpace>60</livingSpace>
           
<numberOfRooms>3</numberOfRooms>
       
</realEstateElement>
   
</realEstateList>
</realestates:realEstates>


Es fällt auf, dass das realEstateList Objekt nicht der Beschreibung in der offerListElement-1.0.xsd folgt:
<xs:complexType name="realEstateList">
       
<xs:sequence>
           
<xs:element name="realEstateElement" minOccurs="0" maxOccurs="100" type="OfferRealEstateForList">
           
</xs:element>
       
</xs:sequence>
   
</xs:complexType>
 
   
<xs:complexType name="OfferRealEstateForList" abstract="true">
       
<xs:annotation>
           
<xs:documentation xml:lang="en">General elements for all real estates within the search context.
           
</xs:documentation>
           
<xs:documentation xml:lang="de-DE">Allgemeine Elemente für alle Immobilienarten.</xs:documentation>
       
</xs:annotation>
       
<xs:complexContent>
           
<xs:extension base="common:AbstractRealEstateForList">
               
<xs:sequence>
                   
<xs:element name="state" type="common:RealEstateState">
                       
<xs:annotation>
                           
<xs:documentation xml:lang="en">publication state of the real estate.</xs:documentation>
                           
<xs:documentation xml:lang="de-DE">Veröffentlichungsstatus der Immobilie.</xs:documentation>
                       
</xs:annotation>
                   
</xs:element>
                   
<xs:element name="titlePicture" type="common:Picture">
                       
<xs:annotation>
                           
<xs:documentation xml:lang="en">The first picture attachment of this real estate</xs:documentation>
                           
<xs:documentation xml:lang="de-DE">Der erste Bildanhang dieser Immobilie</xs:documentation>
                       
</xs:annotation>
                   
</xs:element>
                   
<xs:element name="floorplan" type="xs:boolean" minOccurs="0">
                       
<xs:annotation>
                           
<xs:documentation xml:lang="en">has as attachment a floorplan</xs:documentation>
                           
<xs:documentation xml:lang="de-DE">Grundriss als Objektbild vorhanden</xs:documentation>
                       
</xs:annotation>
                   
</xs:element>
                   
<xs:sequence>
                       
<xs:element ref="common:publishChannels" minOccurs="0"/>
                   
</xs:sequence>
               
</xs:sequence>
               
<xs:attributeGroup ref="Reference" />
           
</xs:extension>
       
</xs:complexContent>
 
   
</xs:complexType>

Es fehlen, u.A. die Attribute state und titlePicture
Dadurch meckert natürlich mein ClassBinding, das natürlich erstmal das Attribut state erwartet:
Traceback (most recent call last):
 
File "<stdin>", line 1, in <module>
 
File "offerListElement.py", line 66, in CreateFromDocument
    saxer
.parse(io.BytesIO(xmld))
 
File "/usr/lib64/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader
.IncrementalParser.parse(self, source)
 
File "/usr/lib64/python2.7/xml/sax/xmlreader.py", line 123, in parse
   
self.feed(buffer)
 
File "/usr/lib64/python2.7/xml/sax/expatreader.py", line 210, in feed
   
self._parser.Parse(data, isFinal)
 
File "/usr/lib64/python2.7/xml/sax/expatreader.py", line 352, in end_element_ns
   
self._cont_handler.endElementNS(pair, None)
 
File "/usr/lib/python2.7/site-packages/pyxb/binding/saxer.py", line 376, in endElementNS
    binding_object
= this_state.endBindingElement()
 
File "/usr/lib/python2.7/site-packages/pyxb/binding/saxer.py", line 226, in endBindingElement
    _location
=info.location)
 
File "/usr/lib/python2.7/site-packages/pyxb/binding/basis.py", line 2484, in append
   
raise pyxb.UnrecognizedContentError(self, self.__automatonConfiguration, value, location)
pyxb
.exceptions_.UnrecognizedContentError: Invalid content {http://rest.immobilienscout24.de/schema/common/1.0}publishChannels at <unknown>[44:12] (expect state)


Ich bitte um Lösungsvorschläge.

Mir freundlichen Grüßen

Richard Neumann

Richard Neumann

unread,
May 26, 2014, 4:13:13 AM5/26/14
to immobilienscou...@googlegroups.com
BUMP!

Dies ist ganz offensichtlich ein Bug, entweder
  • in der XSD
  • in der Implementierung der RestAPI

Wann wird dieser behoben?
Welche Änderungen sind zu erwarten?

  • Änderung der XSD: 
  •     <xs:complexType name="OfferRealEstateForList" abstract="true">
           
    <xs:annotation>
               
    <xs:documentation xml:lang="en">General elements for all real estates within the search context.
               
    </xs:documentation>
               
    <xs:documentation xml:lang="de-DE">Allgemeine Elemente für alle Immobilienarten.</xs:documentation>
           
    </xs:annotation>
           
    <xs:complexContent>
               
    <xs:extension base="common:AbstractRealEstateForList">
                   
    <xs:sequence>

  •                    
    <xs:element name="state" type="common:RealEstateState" minOccurs="0">
                           
    <xs:annotation>
                               
    <xs:documentation xml:lang="en">publication state of the real estate.</xs:documentation>
                               
    <xs:documentation xml:lang="de-DE">Veröffentlichungsstatus der Immobilie.</xs:documentation>
                           
    </xs:annotation>
                       
    </xs:element>
                       
    <xs:element name="titlePicture" type="common:Picture" minOccurs="0">
                           
    <xs:annotation>
                               
    <xs:documentation xml:lang="en">The first picture attachment of this real estate</xs:documentation>
                               
    <xs:documentation xml:lang="de-DE">Der erste Bildanhang dieser Immobilie</xs:documentation>
                           
    </xs:annotation>
                       
    </xs:element>
                       
    <xs:element name="floorplan" type="xs:boolean" minOccurs="0">
                           
    <xs:annotation>
                               
    <xs:documentation xml:lang="en">has as attachment a floorplan</xs:documentation>
                               
    <xs:documentation xml:lang="de-DE">Grundriss als Objektbild vorhanden</xs:documentation>
                           
    </xs:annotation>
                       
    </xs:element>
                       
    <xs:sequence>
                           
    <xs:element ref="common:publishChannels" minOccurs="0"/>
                       
    </xs:sequence>
                   
    </xs:sequence>
                   
    <xs:attributeGroup ref="Reference" />
               
    </xs:extension>
           
    </xs:complexContent>
     
       
    </xs:complexType>
  • Änderung in der RestAPI-Antwort:
    • unbedingte Angabe der Felder
Vielen Dank!

Richard Neumann
Reply all
Reply to author
Forward
0 new messages