473,725 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ne t/sd/2001/TemperatureServ ice.wsdl'
server = WSDL.Proxy(wsdl File)
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\Li b\site-packages\SOAPpy \Client.py",
line 453, in __call__
return self.__r_call(* args, **kw)
File "E:\Program Files\Python\Li b\site-packages\SOAPpy \Client.py",
line 475, in __r_call
self.__hd, self.__ma)
File "E:\Program Files\Python\Li b\site-packages\SOAPpy \Client.py",
line 347, in __call
config = self.config)
File "E:\Program Files\Python\Li b\site-packages\SOAPpy \Client.py",
line 187, in call
r.endheaders()
File "E:\Program Files\Python\li b\httplib.py", line 795, in
endheaders
self._send_outp ut()
File "E:\Program Files\Python\li b\httplib.py", line 676, in
_send_output
self.send(msg)
File "E:\Program Files\Python\li b\httplib.py", line 643, in send
self.connect()
File "E:\Program Files\Python\li b\httplib.py", line 611, in connect
socket.SOCK_STR EAM):
gaierror: (11001, 'getaddrinfo failed')


Dec 23 '05 #1
7 4046
ic*****@gmail.c om 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.xmetho ds.net from your
browser?

what happens if you do
import socket
socket.getaddri nfo("www.xmetho ds.net", 80)
socket.getaddri nfo("services.x methods.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.getaddri nfo("www.xmetho ds.net", 80)
Traceback (most recent call last):
File "<pyshell#1 >", line 1, in -toplevel-
socket.getaddri nfo("www.xmetho ds.net", 80)
gaierror: (11001, 'getaddrinfo failed') socket.getaddri nfo("services.x methods.net", 80)
Traceback (most recent call last):
File "<pyshell#2 >", line 1, in -toplevel-
socket.getaddri nfo("services.x methods.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.getaddri nfo("www.xmetho ds.net", 80)
Traceback (most recent call last):
File "<pyshell#1 >", line 1, in -toplevel-
socket.getaddri nfo("www.xmetho ds.net", 80)
gaierror: (11001, 'getaddrinfo failed') socket.getaddri nfo("services.x methods.net", 80)
Traceback (most recent call last):
File "<pyshell#2 >", line 1, in -toplevel-
socket.getaddri nfo("services.x methods.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.getaddri nfo() will fail.

So today, I installed MSFireWallClien t 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
2261
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 webpage. Here is the script. I appreciate any light that could be shed on the script and why I would get the errors. Thank you,
1
4394
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 you are authorized to access the URL "/~group3/cgi-bin/ack.cgi". You either supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.
0
2505
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 pages - change free space per page to: 10% - remove unused space from database files
2
1360
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 the tools at my disposal to diagnose the situation. I have an existing COM+ / ASP application (the COM+ objects are written in VB 6.0) that I am wanting to migrate forward to .NET (using VB.Net). I have added some ASPX pages to the existing...
12
2545
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 one is a permission error. The project is a VC++ Web Service. It works fine when the service is hosted on the old W2K dev machine, but on the new XP machine I get a permission error when the service tries to open a text file on the Windows...
193
9590
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 speak only of features in the spirit of C; something like object-orientation, though a nice feature, does not belong in C. Something like being able to #define a #define would be very handy, though, e.g: #define DECLARE_FOO(bar) #define...
2
2412
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 Catalogue in SQL. Malformed search requests can generate a variety of errors, which I simply want to catch, set the CustomValidator's IsValid method to false and assign the ErrorMessage to the CustomValidator's Message property. For example: ...
1
1513
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 simultaneous users (about 25-30 rps), everything works fine, although Cold Fusion seems to be a little faster than ASP.NET. When using 2000 simultaneous users (about 50-60 rps), Cold Fusion works really fine but the application in ASP.NET starts to have...
0
306
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 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:
0
8886
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8750
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9168
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9105
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8091
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6010
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2154
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.