473,326 Members | 2,095 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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 3998
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: mikey_boy | last post by:
Hello! Curious if anyone could give me a hand. I wrote this PHP script with makes a simple connection to a mysql database called firstdb and just pulls back the results and displays on the...
1
by: Mike S. Nowostawsky | last post by:
I am getting this error when I try to run a program in my cgi-bin directory (don't know what I'm still missing to make it work): *** Authentication required! This server could not verify that...
0
by: Bill Gates | last post by:
i have two servers this is happenning on. each has a maintenance plan with the same options selected... General Tab - applies to all databases Optimizations Tab - reorganize data and index...
2
by: BryanEverly | last post by:
Hi, I'm struggling with a problem and was hoping that someone on this group could point me in the right direction. I'm not looking for a free ride, just a suggestion as to how best to use all...
12
by: Russ | last post by:
Hello. My new dev machine is running XP Pro. In the past all equipment has only used Windows 2000. I have had a lot of problems getting my projects up and running on the new machine. The current...
193
by: Michael B. | last post by:
I was just thinking about this, specifically wondering if there's any features that the C specification currently lacks, and which may be included in some future standardization. Of course, I...
2
by: Stephen Miller | last post by:
Can the CustomValidator be used to simply report unexpected errors, without requiring Client/Server validation? To explain, say you had a simple text box and button that did a Full-text Search of a...
1
by: Gustavo Barbosa | last post by:
I´m having this problem: I'm stress testing a ASP.NET web application using ACT and comparing results with a previous version of the website (developed in ColdFusion 4.5). When using 300...
0
by: iclinux | last post by:
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.