SOAPpy under xinetd?

H

Harry George

I'm trying to setup a SOAPpy service under xinetd. Has someone done
this sort of thing? Didn't find it from google searches or
documentation. This is probably a sockets-level issue, but I was
hoping someone in python land had done this with SOAPpy before.

The server works fine as simple SOAP server and client pair on
localhost. But when I try to put it under xinetd, it fails. Using
"xinetd -d" I can see it is failing due to address in use. Does this
represent xinetd and SOAPServer competing for use of the port?

Perhaps as a result of failed binding, and perhaps as a separate
issue, the client fails on connection refused. I have hosts.deny
ALL:ALL. For a non-well-known service, I don't see how to add my new
service to hosts.allow. Even when I make an entry in /etc/services,
and provide an entry in hosts.allow, I still get the connection
reset.


---xinetd.d/graphs-----------------
service graphs
{
disable = no
socket_type = stream
protocol = tcp
type = UNLISTED
server = /usr3/lib/app_svr.py
port = 2036
wait = no
user = nobody
instances = 2
nice = 10
only_from = my.clients.here localhost
}


---xinetd -d messages------------------------------
04/11/24@11:20:32: DEBUG: 20011 {cnf_start_services} Started service: graphs
04/11/24@11:20:32: ERROR: 20011 {activate_normal} bind failed (Address already in use (errno = 98)). service = graphs
04/11/24@11:20:32: DEBUG: 20011 {cnf_start_services} mask_max = 6, services_started =

---app_svr.py----------------------------
logging.info("non_ssl")
server = SOAPpy.SOAPServer(("localhost",2036),
)
logging.info("server created")
server.registerFunction(hello)
logging.info("functions added")
server.serve_forever()

---app_client.py---------------------------
SOAPpy.Config.debug=1
soap_url='http://localhost:2036'
proxy=SOAPpy.SOAPProxy(soap_url)
subdirname="myhello"
csv_url="http://example.com"
result=proxy.hello(SOAPpy.StringType(subdirname),
SOAPpy.StringType(csv_url),
)

---app_client messages-------------------------------------
In build.
In dump. obj= myhello
In dump_string.
In gentag.
In dumper.
In dump. obj= http://example.com
In dump_string.
In gentag.
In dumper.
*** Outgoing HTTP headers **********************************************
POST / HTTP/1.0
Host: localhost:2036
User-agent: SOAPpy 0.11.6 (http://pywebsvcs.sf.net)
Content-type: text/xml; charset="UTF-8"
Content-length: 521
SOAPAction: "hello"
************************************************************************
*** Outgoing SOAP ******************************************************
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<hello SOAP-ENC:root="1">
<v1 xsi:type="xsd:string">myhello</v1>
<v2 xsi:type="xsd:string">http://example.com</v2>
</hello>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
************************************************************************
Traceback (most recent call last):
File "a290/hello_client.py", line 135, in ?
main(pargs)
File "a290/hello_client.py", line 106, in main
SOAPpy.StringType(csv_url),
File "/usr/local/lib/python2.3/site-packages/SOAPpy/Client.py", line 453, in __call__
return self.__r_call(*args, **kw)
File "/usr/local/lib/python2.3/site-packages/SOAPpy/Client.py", line 475, in __r_call
self.__hd, self.__ma)
File "/usr/local/lib/python2.3/site-packages/SOAPpy/Client.py", line 347, in __call
config = self.config)
File "/usr/local/lib/python2.3/site-packages/SOAPpy/Client.py", line 201, in call
code, msg, headers = r.getreply()
File "/usr/local/lib/python2.3/httplib.py", line 1049, in getreply
response = self._conn.getresponse()
File "/usr/local/lib/python2.3/httplib.py", line 778, in getresponse
response.begin()
File "/usr/local/lib/python2.3/httplib.py", line 273, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python2.3/httplib.py", line 231, in _read_status
line = self.fp.readline()
File "/usr/local/lib/python2.3/socket.py", line 323, in readline
data = recv(1)
socket.error: (104, 'Connection reset by peer')
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,058
Latest member
QQXCharlot

Latest Threads

Top