469,927 Members | 1,842 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Some errors when running code in diveintopython: (

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')


Dec 23 '05 #1
7 3742
ic*****@gmail.com wrote:
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
import socket
socket.getaddrinfo("www.xmethods.net", 80)
socket.getaddrinfo("services.xmethods.net", 80)


?

</F>

Dec 23 '05 #2
I can visit those two websites above, but when I run your code, I get
those errors(BTW,I have closed my firewall
):
import socket
socket.getaddrinfo("www.xmethods.net", 80)
Traceback (most recent call last):
File "<pyshell#1>", line 1, in -toplevel-
socket.getaddrinfo("www.xmethods.net", 80)
gaierror: (11001, 'getaddrinfo failed') socket.getaddrinfo("services.xmethods.net", 80)
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?

Dec 23 '05 #3

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 ...

Dec 23 '05 #4
Istvan Albert wrote:
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

Dec 23 '05 #5
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
):
import socket
socket.getaddrinfo("www.xmethods.net", 80)
Traceback (most recent call last):
File "<pyshell#1>", line 1, in -toplevel-
socket.getaddrinfo("www.xmethods.net", 80)
gaierror: (11001, 'getaddrinfo failed') socket.getaddrinfo("services.xmethods.net", 80)
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
Dec 23 '05 #6
beryan wrote:
El Fri, 23 Dec 2005 05:18:30 -0800, iclinux escribió:
gaierror: (11001, 'getaddrinfo failed')

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.
Dec 23 '05 #7
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!!

Dec 24 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by mikey_boy | last post: by
1 post views Thread by Mike S. Nowostawsky | last post: by
reply views Thread by Bill Gates | last post: by
12 posts views Thread by Russ | last post: by
193 posts views Thread by Michael B. | last post: by
2 posts views Thread by Stephen Miller | last post: by
1 post views Thread by Gustavo Barbosa | last post: by
reply views Thread by iclinux | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.