Menu

#247 HREF processed before Nillable

v2.1
open
nobody
zsi (169)
5
2008-06-30
2008-06-30
Konrad
No

I'm using ZSI 2.1_a1 with the WSDL here: http://evsapi-stage.nci.nih.gov/evsapi41/services/evsapi41Service?wsdl

The relevant part of the incoming message looks like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<queryObjectResponse xmlns="http://webservice.system.nci.nih.gov">
<queryObjectReturn>
<item xmlns:ns1="urn:domain.evs.nci.nih.gov" xsi:type="ns1:DescLogicConcept">
<hasChildren xsi:nil="true" xsi:type="xsd:boolean"/>

Which results in this error:

File "/usr/lib/python2.5/site-packages/ZSI-2.1_a1-py2.5.egg/ZSI/TC.py", line 156, in SimpleHREF
ps.Backtrace(elt))
ZSI.EvaluateException: Requiredboolean missing
[Element trace: /soapenv:Envelope/soapenv:Body/queryObjectResponse/queryObjectReturn/item/hasChildren]

This is because the Boolean parse method checks for HREF before checking if the element is nilled. It's also done incorrectly in the Decimal class, but correctly in the Integer class.

I have attached a patch to fix the Boolean class only, which is the only one I'm using. All I did was to move the nilled check up before the SimpleHREF, as it is in the Integer class.

If this fix makes sense, it should probably also be done for the Decimal class.

Discussion

  • Konrad

    Konrad - 2008-06-30

    Patch to fix boolean parsing

     
  • Halturin Taras

    Halturin Taras - 2008-07-11

    Logged In: YES
    user_id=79559
    Originator: NO

    The same problem with dateTime format... for example:

    wsdl-data:
    ...
    <element name="portingDate" nillable="true" minOccurs="0" maxOccurs="1" type="xsd:dateTime"/>
    ...

    POST /UniversalRegisterRequestInterface/UniversalRegisterRequestInterface HTTP/1.1
    Host: sheff.fttb.corbina.net
    Accept-Encoding: identity
    Content-Length: 1161
    Content-Type: text/xml; charset="utf-8"
    SOAPAction: "updateRequest"

    <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body xmlns:ns1="http://fttbUniversalRegisterRequestInterface.fttb.at.com"><ns1:updateRequest><requestID>123</requestID><status>1</status><conn_type>1</conn_type><login>fffff</login><password>uuuu</password><phone>000</phone><lastName>Petrov</lastName><firstName>Petya</firstName><patronymicName>ooo</patronymicName><email>asdf@adsf</email><townName>msk</townName><townID>33</townID><streetName>poiupoiupoiu</streetName><streetID>12341234</streetID><house>44</house><flat>444</flat><objectCode>444</objectCode><docType>1</docType><docID>32</docID><docNumber>66</docNumber><docDate>2008-07-11T14:51:21.004Z</docDate><docIssue>33</docIssue><service>9999</service><tariff>ttttttttt</tariff><infoSource>3</infoSource><comment>asfdasdf</comment><portingDate xsi:nil="true" xmlns=""/></ns1:updateRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
    HTTP/1.1 200 OK
    Date: Fri, 11 Jul 2008 11:06:07 GMT
    Server: Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4 mod_ssl/2.2.3 OpenSSL/0.9.8c
    Transfer-Encoding: chunked
    Content-Type: text/xml

    309
    <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Unparseable message</faultstring><detail><Eo2ac2dcd30150 id="o2ac2dcd30150">&lt;ZSI:ParseFaultDetail&gt;
    &lt;ZSI:string&gt;Non-nillable element is NIL&lt;/ZSI:string&gt;
    &lt;ZSI:trace&gt;/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:updateRequest/portingDate&lt;/ZSI:trace&gt;
    &lt;/ZSI:ParseFaultDetail&gt;
    </Eo2ac2dcd30150></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
    0

     

Log in to post a comment.