kartagis / pysimplesoap

Automatically exported from code.google.com/p/pysimplesoap
0 stars 0 forks source link

Add support for multiple interfaces #79

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In SoapDispatcher, if you do not define a location, it doesn't work. This is 
problematic in particular when binding to several IPs (or even, if you don't 
know or want to know the actual IP of the server).

Solution:

In SoapDispatcher:
    def updateForIP(self, ip):
        self.location = "http://%s:%s/" % (ip, self.port)
        self.action = 'http://%s:%s/' % (ip, self.port)
        self.namespace = "http://%s:%s/sample.wsdl" % (ip, self.port)

In SOAPHandler.do_GET, add this line as the first one:
        self.server.dispatcher.updateForIP(self.headers["Host"].split(":")[0])

This way, anyone who requests the WS, will get the location set to wherever the 
dispatcher is running.

Original issue reported on code.google.com by ismael...@gmail.com on 18 Sep 2012 at 10:26

GoogleCodeExporter commented 8 years ago
Added to the docs, thanks for you contribution!

Original comment by reingart@gmail.com on 25 May 2014 at 4:05