On 11/30/11 16:34, LE MEUR Laurent wrote:
First, I want to thank Burak for his work on rpclib ; I successfullly
used it along with Suds for simple needs.

you're welcome, and also thanks for taking time to test my beta software.

Then, I'd like to ask some help about an issue that is not related to
rpclib per se, but rather to the default http server used for tests.

I tried to connect an MS Infopath form to an rpclib WS, but the client
sends an OPTIONS request, and the server responds with a 405. How can I
configure the http server to accept this verb ?

So, here's the code responsible for that:

https://github.com/arskom/rpclib/blob/master/src/rpclib/server/wsgi.py#L160

which gets allowed_http_verbs from its input protocol, as shown here:

https://github.com/arskom/rpclib/blob/master/src/rpclib/server/wsgi.py#L144

which comes from here:

https://github.com/arskom/rpclib/blob/master/src/rpclib/protocol/_base.py#L62

so, here's what you need to do to avoid HTTP 405:

    import rpclib.protocol
    rpclib.protocol.ProtocolBase.allowed_http_verbs.append('OPTIONS')

    application = Application(in_protocol=Soap11(...), ...)

Beware that as of now it's a class attribute, so that change affects any Application instance in that process. I should probably make it an instance attribute so that it's more configurable. In the mean time, you can change the _allowed_http_verbs attribute in the ServerBase instance.

That said, i don't know what InfoPath expects as response to the OPTIONS request, so you may need a hook for different HTTP verbs, which you can use to return responses to arbitrary requests. I just implemented this, you may find it in my personal fork. (http://github.com/plq/rpclib)

let me know how it goes.

best,
burak

ps: these should probably be in the documentation somewhere. *wink* *wink*

_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap

Reply via email to