首先建议你安装一个扩展库安装工具,推荐easy_install工具,你可以在网上下载,也可以先去下载一个 ez_setup.py ,这个程序下载后用python.exe运行一下,会自动根据你的版本帮你下载和安装一个easy_install,目前只支持到python2.6,看来python3目前还是没有太多的公司在使用啊。。。
后面就可以用这个easy_install工具进行第三方库的下载了,比如我要下载soaplib这个库,可以执行easy_install soaplib,它会自己去相关网站查找这个库,以及这个库的依赖,如果你手工安装,那依赖会把你搞疯掉的
关于哪个库更适用做webservice
现在网上查到最多的是ZSI或者叫soappy,实际上05年之后就没有更新了,而且只支持到2.5,放弃
soaplib,这个目前2.0,还是不错的,不过手册不是太好读,只有server端的用法,client我没找到suds,这个我在用,用起来比较简单,示例代码如下:
[python] view plain copy
The library is now ready to use. We start by importing the suds library, creating a client based on a SOAP url, and asking the library to print the SOAP web service methods that are available to us.
import suds
url = "http://www.ecubicle.net/iptocountry.asmx?wsdl"
client = suds.client.Client(url)
print client
From the output of the last print command, we learn that there is a method called FindCountryAsString that takes one argument: the IP address.
print client.service.FindCountryAsString("194.145.200.104")
And it shows (edited for readability):
<?xml version="1.0"?>
<IPAddressService>
<country>Netherlands</country>
</IPAddressService>
Normally you want to have the contents of the SOAP body. This is what suds provides in a very elegant way. However, you’re a bit stuck when you want to get something from the SOAP header. The author of suds realised this and made a backdoor to get the information anyway. We start by showing what the function last_received contains:
print client.last_received()
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope>
<soap:Header>
<ResponseHeader xmlns="">
<resultCode>1000</resultCode>
<resultDescription>Success</resultDescription>
</ResponseHeader>
</soap:Header>
<soap:Body>
...
</soap:Body>
</soap:Envelope>
We can get portions of this data by doing some XML handling. Let’s say we want to print the resultCode:
print client.last_received().getChild("soap:Envelope").getChild("soap:Header")
.getChild("ResponseHeader").getChild("resultCode").getText()
内行的近义词:
老手、里手、熟行、行家、好手、熟手、专家、能手
内行的近义词详细信息:
lao shou
1、老手
示例:如果你是个IT老手,这些所说的估计你大部分都遇到过,而且很有可能还有自己的心得—当然,非常欢迎你花几秒钟的时间把你的所知道的其它小秘密添加到本文的讨论中。
li shou
2、里手
示例:ZSI是RichSalz的智慧之作,他是Python/XML包的积极贡献人,也是因特网基础架构和安全方面的几个重要标准的拟定工作的行家里手。
shu xing
3、熟行
示例:我们经常听人说,人们因工作过度而垮下来,可是现实上十有八九是因为饱受担忧或焦炙的熬煎。(英国银熟行卢伯克.J。)
xing jia
4、行家
示例:“不,大人,不。”管家回答说,他的全身神经质般的.颤抖了一下,基督山对喜怒哀乐的洞察可谓行家,一见便知道他内心里非常不安。
hao shou
5、好手
示例:瞧瞧,旺达,我曾经是一个捉虫好手,而且我的眼睛高高地长在头顶,这样前后左右我都能一下子看得一清二楚,可是看看现在的我,眼睛长在脸上,我一次只能朝一个方向看。
shu shou
6、熟手
示例:对因特网熟手来说,这是最新潮的挣外快的方式之一;关于怎样从网络挣钱最好,有成打的视频、网站和博客给你建议。
zhuan jia
7、专家
示例:专业化的问题是它只能让你成为专家,切断你与世界上其他任何东西的联系,不仅如此,还切断你与自身其他潜能的联系。
neng shou
8、能手
示例:在他的研究工作中,她发现用一年时间每周花上五小时或者更长时间来玩这种游戏的人任务处理能力能够达到华生和斯查尔的超级多能手同样水平。
内行拼音和解释:
(A)、词语内行的拼音: nei xing
(B)、词语内行的解释:(1)对某种事情或工作有丰富的知识和经验:他对养蜂养蚕都很~。(2)内行的人。