Some errors when running code in diveintopython: (

I

iclinux

Environment:
WinXP SP2 + Python 2.4.2, with SOAPpy-0.11.6.zip, fpconst-0.7.2.zip,
and PyXML-0.8.4.win32-py2.4.exe installed.

Problem:
I'm reading DiveIntoPython these days. When running code of "Example
12.11. Calling A Web Service Through A WSDL Proxy", I got some errors
as follow. Will you please give me some suggestion?

IDLE 1.1.2's Output:
from SOAPpy import WSDL
wsdlFile = 'http://www.xmethods.net/sd/2001/TemperatureService.wsdl'
server = WSDL.Proxy(wsdlFile)
server.methods.keys() [u'getTemp']
server.getTemp('90210')

Traceback (most recent call last):
File "<pyshell#4>", line 1, in -toplevel-
server.getTemp('90210')
File "E:\Program Files\Python\Lib\site-packages\SOAPpy\Client.py",
line 453, in __call__
return self.__r_call(*args, **kw)
File "E:\Program Files\Python\Lib\site-packages\SOAPpy\Client.py",
line 475, in __r_call
self.__hd, self.__ma)
File "E:\Program Files\Python\Lib\site-packages\SOAPpy\Client.py",
line 347, in __call
config = self.config)
File "E:\Program Files\Python\Lib\site-packages\SOAPpy\Client.py",
line 187, in call
r.endheaders()
File "E:\Program Files\Python\lib\httplib.py", line 795, in
endheaders
self._send_output()
File "E:\Program Files\Python\lib\httplib.py", line 676, in
_send_output
self.send(msg)
File "E:\Program Files\Python\lib\httplib.py", line 643, in send
self.connect()
File "E:\Program Files\Python\lib\httplib.py", line 611, in connect
socket.SOCK_STREAM):
gaierror: (11001, 'getaddrinfo failed')
 
F

Fredrik Lundh

I'm reading DiveIntoPython these days. When running code of "Example
12.11. Calling A Web Service Through A WSDL Proxy", I got some errors
as follow. Will you please give me some suggestion?
gaierror: (11001, 'getaddrinfo failed')

this usually means that your computer (or your nameserver) have problems
looking up the host name. it's not a python problem.

have you checked your firewall settings (and/or firewall logs) ?

can you reach www.xmethods.net and services.xmethods.net from your
browser?

what happens if you do

?

</F>
 
I

iclinux

I can visit those two websites above, but when I run your code, I get
those errors(BTW,I have closed my firewall
):

Traceback (most recent call last):
File "<pyshell#1>", line 1, in -toplevel-
socket.getaddrinfo("www.xmethods.net", 80)
gaierror: (11001, 'getaddrinfo failed')
Traceback (most recent call last):
File "<pyshell#2>", line 1, in -toplevel-
socket.getaddrinfo("services.xmethods.net", 80)
gaierror: (11001, 'getaddrinfo failed')
what can I do?
 
I

Istvan Albert

must be something with your settings ...

I remeber once I had truly puzzling problem that manifested itself the
same way ... Firefox and cygwin python would work fine but the windows
python would raise errors when trying to connect via http ...

.... finally I realized that the day before IE was set to use a proxy
server ( to capture traffic for testing but the proxy was not on that
moment) ... I know little on how Windows works but it was quite a
surprise that setting IE to work some way had some unwanted
reprecussions somewhere else ...
 
D

David Wahler

Istvan said:
I remeber once I had truly puzzling problem that manifested itself the
same way ... Firefox and cygwin python would work fine but the windows
python would raise errors when trying to connect via http ...

... finally I realized that the day before IE was set to use a proxy
server ( to capture traffic for testing but the proxy was not on that
moment) ... I know little on how Windows works but it was quite a
surprise that setting IE to work some way had some unwanted
reprecussions somewhere else ...

See the documentation for urllib.urlopen:

"""
In a Windows environment, if no proxy environment variables are set,
proxy settings are obtained from the registry's Internet Settings
section.
"""

-- David
 
B

beryan

El Fri, 23 Dec 2005 05:18:30 -0800, iclinux escribió:
I can visit those two websites above, but when I run your code, I get
those errors(BTW,I have closed my firewall
):


Traceback (most recent call last):
File "<pyshell#1>", line 1, in -toplevel-
socket.getaddrinfo("www.xmethods.net", 80)
gaierror: (11001, 'getaddrinfo failed')

Traceback (most recent call last):
File "<pyshell#2>", line 1, in -toplevel-
socket.getaddrinfo("services.xmethods.net", 80)
gaierror: (11001, 'getaddrinfo failed')

what can I do?


Have you got a Firewall ?
Take a look over firewall settings and give Python rights for accesing
port 80
 
H

Heiko Wundram

beryan said:
El Fri, 23 Dec 2005 05:18:30 -0800, iclinux escribió:
Take a look over firewall settings and give Python rights for accesing
port 80

Well, rather he should take a look at allowing Python to resolve host names.
That's what this error is about.

--- Heiko.
 
I

iclinux

thanks all ! I've solved this problem:

Let me show my net environment first. My pc is in a local network, and
through a proxy server can I reach the Internet, so I changed my
Internet Settings.

It seems that everything goes well, I can surf Internet, etc, but what
a pity, I can't resolve a host's address by its name by gethostbyname()
in C Language; in python, socket.getaddrinfo() will fail.

So today, I installed MSFireWallClient which will connect to the ISA
server. and after that, everything works: )

Thanks again, Merry Christmas and a Happy New Year!!
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top