[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Demexp-dev] Re: Add response: erreur pyhton

From: Lyu Abe
Subject: Re: [Demexp-dev] Re: Add response: erreur pyhton
Date: Wed, 12 Mar 2008 11:04:24 +0100
User-agent: Thunderbird (Windows/20080213)

Hi again,

I got this error:

  File "C:\Program Files\wamp\www\Demexp\python\", line 335, in


  File "C:\Program Files\Python25\Lib\", line 1147, in __call__
    return self.__send(self.__name, args)

  File "C:\Program Files\Python25\Lib\", line 1437, in

  File "C:\Program Files\Python25\Lib\", line 1201, in request
    return self._parse_response(h.getfile(), sock)

  File "C:\Program Files\Python25\Lib\", line 1340, in
    return u.close()

  File "C:\Program Files\Python25\Lib\", line 787, in close
    raise Fault(**self._stack[0])

Fault: <Fault 1: 'exceptions.Exception:method "add_response" is not

and the same error for new_question:

Fault: <Fault 1: 'exceptions.Exception:method "new_question" is not

I am using the demo/demo account.


David MENTRE a écrit :
Hello Lyu,

2008/3/11, Lyu Abe <address@hidden>:
        this_question = s.question_info(cookie, index, 1)
        marshalled_qu = marshal.dumps(this_question[0]['q_id'])
        marshalled_resp = marshal.dumps(new_response)
        s.add_response(cookie, marshalled_qu,marshalled_resp,"")

Well, I don't really understand why you would need such marshal calls.

If you look at the code of the XML RPC proxy, you see for example this
code to add a new response (line 157):

    def add_response(self, cookie, question_id, response_desc, response_link):
        ret = self.onc.add_response(cookie, question_id,
        if ret != DemexpRpc.const.rt_ok:
            raise RpcError(ret)
        return ret

"cookie" is the cookie you got from login().

"question_id" is a Python integer.

"response_desc" and "response_link" are two Python strings.

When you use ONC RPC calls, you can use regular Python simple types as
arguments. Where are those marshal calls coming from?

You'll find other examples of Python code to call the demexp server in
the source code of pydemexp (, in
files "" and "".

If you are able to get your new response as a regular Python string,
you should be able to add it to the server pretty easily.

I hope this helps,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]