python和dotnet的webservice互访
2007-08-22 22:46
一、用SOAPpy访问dotnet webservice
dotnet的webservice
<WebMethod()> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
<WebMethod()> _
Public Function HelloWorld2(ByVal s As String) As String
Return "Hello World2" + s
End Function
<WebMethod()> _
Public Function HelloWorld3(ByVal i As Int16, ByVal j As Int16) As String
Return "Hello World3" + (i + j).ToString()
End Function
命名空音后加一句 SoapDocumentService(Use:=SoapBindingUse.Encoded)
访问
>>>from SOAPpy import WSDL
>>> server= WSDL.Proxy("http://192.168.1.3/mywebservice/Service1.asmx?WSDL
")
>>> server.HelloWorld()
'Hello World'
>>> server.HelloWorld('abcdefg')
'Hello World'
>>> server.HelloWorld2('abcdefg')
'Hello World2'
>>> server.HelloWorld2(s = 'abcdefg') #有参数时,需带上参数名
'Hello World2abcdefg'
>>> server.HelloWorld3(i=1,j=2) #暂未解决
Traceback (most recent call last):
File "<pyshell#43>", line 1, in -toplevel-
server.HelloWorld3(i=1,j=2)
File "c:\python24\Lib\site-packages\SOAPpy\Client.py", line 453, in __call__
相关文档:
1.常用方法,不带参数
def decator(func):
def inner_func(*args):
args = (i * 2 for i in args)
return func(*args)
return inner_func
@decator
def add(a, ......
RRD是Round Robin Database的意思,RRDTool是用来管理RRD的一个工具。RRDTool的主页在这里,Wikipedia的页面在这里。RRD其实就是一个时序数据库,使用一个固定大小的环型buffer,适用于存储一些统计性的信息,如CPU负载呀,气温变化呀。我为什么要说这个东西呢,因为XenServer里的性能统计是用的RRD,你可以访问诸如http:// ......
writeblog.csdn.net writeblog.csdn.net/PostEdit.aspx
这个程序很早以前就写过了,而且是参考的别人的写,具体谁的发在哪里我都忘记了。这里就算是半原创了,如有侵权请及时通知改正。
因为从今天1月1号开始,Google上订阅的天气预报服务已经取消了,估计是Google被施加压力了。反正是收不到天气预报了。正好重拾以前 ......
[root@pku-fan MySQL]# cat limbs.sql
CREATE DATABASE cookbook;
USE cookbook;
DROP TABLE IF EXISTS limbs;
CREATE TABLE limbs
(
thing VARCHAR(20), # what the thing is
legs INT, ......