Roman Prykhodchenko
Roman Prykhodchenko

Reputation: 13325

Get an IP adress of a client of a SOAP service

I'm writing a SOAP service using python and soaplib. I need to get IP adresses of all clients of the service to store them to the log file. How can I do that?

Upvotes: 0

Views: 301

Answers (1)

ars
ars

Reputation: 123558

One way to do this is to implement a "hook" which is called at different stages of the wsgi executation. See the section "Hooks" in the soaplib readme file for details and the example hook.py in that distribution.

For example, you could implement onMethodExec and then use the wsgi environ.get('REMOTE_ADDR') to obtain the client's IP address and log it.

Upvotes: 1

Related Questions