problem with python zsi

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rafal Zawadzki

    #1

    problem with python zsi

    Hi. I tried earlier to write python zsi mail list, but nobody answered.

    I am using ZSI 1.7/2.0rc1 with TTPro Soap SDK. The wsdl file can be found
    here:


    My wsdl is the same, only different is the address of the cgi file.

    for example i cannot use defectRequest method:

    req = getDefectReques t()
    req._defectNumb er = 140
    req._cookie = cookie #cookie is valid int
    resp = server.getDefec t(req)


    What i get:
    _______________ _______________ ___ Wed Mar 15 10:42:17 2006 REQUEST:
    <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:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/"><SOAP-ENV:Header></SOAP-ENV:Header><SOA P-ENV:Body
    xmlns:ns1="urn: testtrack-interface"><ns1 :getDefect><coo kie
    xsi:type="xsd:l ong">197437</cookie><defectN umber
    xsi:type="xsd:l ong">140</defectNumber><s ummary
    xsi:nil="1"></summary><bDownl oadAttachments
    xsi:nil="1"></bDownloadAttach ments></ns1:getDefect></SOAP-ENV:Body></SOAP-ENV:Envelope>


    _______________ _______________ ___ Wed Mar 15 10:42:17 2006 RESPONSE:
    500
    Internal Server Error
    -------
    Date: Wed, 15 Mar 2006 09:41:37 GMT
    Server: Apache/1.3.33 (Debian GNU/Linux)
    Content-Length: 586
    Content-Type: text/xml; charset=utf-8
    Connection: close

    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap .org/soap/encoding/"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
    xmlns:ttns="urn :testtrack-interface"><SOA P-ENV:Header></SOAP-ENV:Header><SOA P-ENV:Body
    SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/"
    id="_0"><SOAP-ENV:Fault><faul tcode>SOAP-ENV:Client</faultcode><faul tstring>XML
    syntax
    error</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
    Traceback (most recent call last):
    File "./tt.py", line 42, in ?
    resp = server.getDefec t(req)
    File "/home/bluszcz/python/testtrack/ttsoapcgi_servi ces.py", line 285, in
    getDefect
    response = self.binding.Re ceive(getDefect Response.typeco de)
    File "/usr/lib/python2.4/site-packages/ZSI/client.py", line 415, in
    Receive
    raise FaultException( msg)
    ZSI.FaultExcept ion: XML syntax error

    The second error:

    req = getGlobalUserLi stRequest()
    req._cookie=coo kie
    resp = server.getGloba lUserList(req)
    _______________ _______________ ___ Wed Mar 15 10:47:15 2006 REQUEST:
    <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:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/"><SOAP-ENV:Header></SOAP-ENV:Header><SOA P-ENV:Body
    xmlns:ns1="urn: testtrack-interface"><ns1 :getGlobalUserL ist><cookie
    xsi:type="xsd:l ong">197437</cookie></ns1:getGlobalUs erList></SOAP-ENV:Body></SOAP-ENV:Envelope>
    _______________ _______________ ___ Wed Mar 15 10:47:15 2006 RESPONSE:
    200
    OK
    -------
    Date: Wed, 15 Mar 2006 09:46:34 GMT
    Server: Apache/1.3.33 (Debian GNU/Linux)
    Content-Length: 537
    Content-Type: text/xml; charset=utf-8

    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap .org/soap/encoding/"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
    xmlns:ttns="urn :testtrack-interface"><SOA P-ENV:Header></SOAP-ENV:Header><SOA P-ENV:Body
    SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/"
    id="_0"><ttns:g etGlobalUserLis tResponse></ttns:getGlobalU serListResponse ></SOAP-ENV:Body></SOAP-ENV:Envelope>
    Traceback (most recent call last):
    File "./tt.py", line 40, in ?
    resp = server.getGloba lUserList(req)
    File "/home/bluszcz/python/testtrack/ttsoapcgi_servi ces.py", line 454, in
    getGlobalUserLi st
    response = self.binding.Re ceive(getGlobal UserListRespons e.typecode)
    File "/usr/lib/python2.4/site-packages/ZSI/client.py", line 421, in
    Receive
    reply = self.ps.Parse(t c)
    File "/usr/lib/python2.4/site-packages/ZSI/parse.py", line 319, in Parse
    return how.parse(self. body_root, self)
    File "/usr/lib/python2.4/site-packages/ZSI/TCcompound.py", line 199, in
    parse
    '" missing from struct', ps.Backtrace(el t))
    ZSI.EvaluateExc eption: Element "_GlobalUserLis t" missing from struct
    [Element
    trace: /SOAP-ENV:Envelope/SOAP-ENV:Body/ttns:getGlobalU serListResponse]

    But when I am using ZSI 1.7:
    req = getDefectReques tWrapper()
    req._defectNumb er = 140
    req._cookie = int(cookie)
    resp = server.getDefec t(req)

    I got correct XML but python fault:

    Traceback (most recent call last):
    File "./tt.py", line 47, in ?
    resp = server.getDefec t(req)
    File "/home/bluszcz/python/testtrack/ttsoapcgi_servi ces.py", line 850, in
    getDefect
    response = self.binding.Re ceive(getDefect ResponseWrapper ())
    File "/usr/lib/python2.4/site-packages/ZSI/client.py", line 325, in
    Receive
    return self.ps.Parse(t c)
    File "/usr/lib/python2.4/site-packages/ZSI/parse.py", line 311, in Parse
    return how.parse(self. body_root, self)
    File "/usr/lib/python2.4/site-packages/ZSI/TCcompound.py", line 107, in
    parse
    value = what.parse(c_el t, ps)
    File "/usr/lib/python2.4/site-packages/ZSI/TCcompound.py", line 107, in
    parse
    value = what.parse(c_el t, ps)
    File "/usr/lib/python2.4/site-packages/ZSI/TCcompound.py", line 327, in
    parse
    item = self.ofwhat.par se(c, ps)
    File "/usr/lib/python2.4/site-packages/ZSI/TCcompound.py", line 72, in
    parse
    self.checkname( elt, ps)
    File "/usr/lib/python2.4/site-packages/ZSI/TC.py", line 141, in checkname
    if self.nspname and ns != self.nspname:
    AttributeError: CReportedByReco rd_Def instance has no attribute 'nspname'

    another:
    one thing: 1.7 request:
    <?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap .org/soap/encoding/"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
    xmlns:ZSI="http ://www.zolera.com/schemas/ZSI/"
    SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/" >
    <SOAP-ENV:Body>
    <getDefect xmlns="urn:test track-interface">
    <cookie xsi:type="xsd:l ong">197600</cookie>
    <defectNumber xsi:type="xsd:l ong">140</defectNumber>
    </getDefect>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>


    2.0 request:
    <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:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/">
    <SOAP-ENV:Header></SOAP-ENV:Header><SOA P-ENV:Body
    xmlns:ns1="urn: testtrack-interface"><ns1 :getDefect><coo kie
    xsi:type="xsd:l ong">197644</cookie><defectN umber
    xsi:type="xsd:l ong">140</defectNumber><s ummary
    xsi:nil="1"></summary><bDownl oadAttachments
    xsi:nil="1"></bDownloadAttach ments></ns1:getDefect></SOAP-ENV:Body></SOAP-ENV:Envelope>
    according to:
    http://sourceforge.net/mailarchive/m...sg_id=10277851

    I added:
    * if name or 1: *

    but now I have got:
    Traceback (most recent call last):
    File "./tt.py", line 47, in ?
    resp = server.getDefec t(req)
    File "/home/bluszcz/python/testtrack/ttsoapcgi_servi ces.py", line 850, in
    getDefect
    response = self.binding.Re ceive(getDefect ResponseWrapper ())
    File "/usr/lib/python2.4/site-packages/ZSI/client.py", line 325, in
    Receive
    return self.ps.Parse(t c)
    File "/usr/lib/python2.4/site-packages/ZSI/parse.py", line 311, in Parse
    return how.parse(self. body_root, self)
    File "/usr/lib/python2.4/site-packages/ZSI/TCcompound.py", line 111, in
    parse
    raise e
    ZSI.EvaluateExc eption: getDefectRespon se._pDefect: pDefect.eventli st: Sorry,
    no multi-dimensional arrays
    [Element
    trace: /SOAP-ENV:Envelope/SOAP-ENV:Body/ttns:getDefectR esponse/pDefect/eventlist/item[2]]



    --
    つた
    ,,To jest Unix. Daje Ci wystarczająco dużo liny, abyś mógł się powiesić.''
    Miquel van Smoorenburg miquels@cistron .nl
Working...