[Soap-Python] rpclib regressions

azurIt azurit at pobox.sk
Tue Jan 24 22:41:04 CET 2012


Ok, i fixed it by replacing 'utf8' with 'utf-8' everywhere :)

azur



______________________________________________________________
> Od: "azurIt" <azurit at pobox.sk>
> Komu: <soap at python.org>
> Dátum: 24.01.2012 19:34
> Predmet: Re: [Soap-Python] rpclib regressions
>
>here is the request + response, no errors was logged on server side and data in XML looks ok (so the problem is with suds + SAX, it just cannot parse the XML):
>
><?xml version="1.0" encoding="UTF-8"?>
><SOAP-ENV:Envelope xmlns:ns0="ComplexTypes" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="elbia.director" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
>   <SOAP-ENV:Header/>
>   <ns1:Body>
>      <ns2:check_token>
>         <ns2:token>censored</ns2:token>
>         <ns2:perms>
>            <ns0:and>nic</ns0:and>
>         </ns2:perms>
>         <ns2:backend_name>censored</ns2:backend_name>
>      </ns2:check_token>
>   </ns1:Body>
></SOAP-ENV:Envelope>
>
>
>
><?xml version='1.0' encoding='utf8'?>
><senv:Envelope xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing" xmlns:tns="elbia.director" xmlns:plink="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:senc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s0="ComplexTypes" xmlns:s12env="http://www.w3.org/2003/05/soap-envelope/" xmlns:s12enc="http://www.w3.org/2003/05/soap-encoding/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:senv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
>   <senv:Body>
>      <tns:check_tokenResponse>
>         <tns:check_tokenResult>
>            <s0:data>
>               ..censored data..
>            </s0:data>
>            <s0:state>ok</s0:state>
>         </tns:check_tokenResult>
>      </tns:check_tokenResponse>
>   </senv:Body>
></senv:Envelope>
>
>
>
>
>look here:
>encoding='utf8'
>
>earlier versions of rpclib were sending 'utf-8'.
>
>
>
>______________________________________________________________
>> Od: "Burak Arslan" <burak.arslan at arskom.com.tr>
>> Komu: azurIt <azurit at pobox.sk>
>> Dátum: 24.01.2012 19:12
>> Predmet: Re: [Soap-Python] rpclib regressions
>>
>> CC: soap at python.org
>>On 01/24/12 20:06, azurIt wrote:
>>> the last working version is 2.4.7, all other are raising that strange SAX error. here is complete traceback (from 2.5.0):
>>>
>>>
>>> Traceback (most recent call last):
>>>    File "/usr/lib/python2.5/site-packages/rpclib-2.5.0_beta-py2.5.egg/rpclib/application.py", line 102, in process_request
>>>      ctx.service_class.event_manager.fire_event('method_call', ctx)
>>>    File "/usr/lib/python2.5/site-packages/rpclib-2.5.0_beta-py2.5.egg/rpclib/_base.py", line 308, in fire_event
>>>      handler(ctx)
>>>    File "<censored>", line 3309, in run_before
>>>      perm = lib._check_token(ctx.in_object[0], ctx.descriptor.udp["perms"])
>>>    File "<censored>", line 188, in _check_token
>>>      return directorlib.call.check_token(token, perms, config.backend_name)
>>>    File "<censored>", line 88, in __call__
>>>      result = caller(*args2)
>>>    File "build/bdist.linux-x86_64/egg/suds/client.py", line 542, in __call__
>>>      return client.invoke(args, kwargs)
>>>    File "build/bdist.linux-x86_64/egg/suds/client.py", line 602, in invoke
>>>      result = self.send(soapenv)
>>>    File "build/bdist.linux-x86_64/egg/suds/client.py", line 643, in send
>>>      result = self.succeeded(binding, reply.message)
>>>    File "build/bdist.linux-x86_64/egg/suds/client.py", line 678, in succeeded
>>>      reply, result = binding.get_reply(self.method, reply)
>>>    File "build/bdist.linux-x86_64/egg/suds/bindings/binding.py", line 145, in get_reply
>>>      replyroot = sax.parse(string=reply)
>>>    File "build/bdist.linux-x86_64/egg/suds/sax/parser.py", line 136, in parse
>>>      sax.parse(source)
>>>    File "/usr/lib/python2.5/site-packages/_xmlplus/sax/expatreader.py", line 109, in parse
>>>      xmlreader.IncrementalParser.parse(self, source)
>>>    File "/usr/lib/python2.5/site-packages/_xmlplus/sax/xmlreader.py", line 123, in parse
>>>      self.feed(buffer)
>>>    File "/usr/lib/python2.5/site-packages/_xmlplus/sax/expatreader.py", line 220, in feed
>>>      self._err_handler.fatalError(exc)
>>>    File "/usr/lib/python2.5/site-packages/_xmlplus/sax/handler.py", line 38, in fatalError
>>>      raise exception
>>> SAXParseException:<unknown>:1:30: unknown encoding
>>>
>>>
>>>
>>> Error is raising from function, which is doing checking of permissions on remote server (via SOAP call). It is sending 'and' and 'or' xml elements, maybe this is the problem (the element names). But it was working fine until 2.5.0.
>>
>>
>>all right, this is a suds backtrace. you're making a suds request from a 
>>rpclib event, which tanks in a place completely irrelevant with rpclib. 
>>you should either provide me information from the other side of the 
>>communication, or the xml traffic itself.
>>
>>
>>
>>>
>>>
>>> ______________________________________________________________
>>>> Od: "Burak Arslan"<burak.arslan at arskom.com.tr>
>>>> Komu: azurIt<azurit at pobox.sk>
>>>> Dátum: 24.01.2012 18:56
>>>> Predmet: Re: [Soap-Python] rpclib regressions
>>>>
>>>> CC: soap at python.org
>>>> On 01/24/12 19:43, azurIt wrote:
>>>>> Hi,
>>>>>
>>>>> i just tried to upgrade to 2.5.2 (from 2.4.5) and i come accross HUGE problems. first of all, there is no 'soft' validation in protocol/xml/_base.py so this:
>>>>> in_protocol=Soap11(validator='soft')
>>>>>
>>>>> was raising ValueError. I fixed it in code and strange things started to happend then:
>>>>> SAXParseException:<unknown>:1:30: unknown encoding
>>>>>
>>>>> i wasn't able to fix this and downgraded back to 2.4.5 :(
>>>>>
>>>> hi azur.
>>>>
>>>> i fixed the ValueError with validator='soft' in my personal fork. but i
>>>> don't understand what throws the encoding error. can you provide some
>>>> code that exhibits the problem?
>>>>
>>>> thanks
>>>> burak
>>>>
>>>>
>>>>
>>> _______________________________________________
>>> Soap mailing list
>>> Soap at python.org
>>> http://mail.python.org/mailman/listinfo/soap
>>
>>
>_______________________________________________
>Soap mailing list
>Soap at python.org
>http://mail.python.org/mailman/listinfo/soap
>


More information about the Soap mailing list