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__
相关文档:
python应用领域介绍
Python作为一种功能强大且通用的编程语言而广受好评,它具有非常清晰的语法特点,适用于多种操作系统,目前在国际上非常流行,正在得到越来越多的应用。
下面就让我们一起来看看它的强大功能:
Python(派森),它是一个简单的、解释型的、交互式的、可移植的、面向对象的超高级语 ......
'''gen_python_api.py generates a python.api file for SciTE
The generated api file includes
*) all Python keywords
*) all builtin functions
*) all module attributes
Module functions are represented by their docstring if available,
otherwise by the function definition from the source file. ......
Python 3 是 Guido van Rossum 功能强大的通用编程语言的最新版本。它虽然打破了与 2.x 版本的向后兼容性,但却清理了某些语法方面的问题。本文是这个由两部分组成的系列文章中的第二篇,本文构建在此系列 前一期文章 的基础之上,内容涵盖了 Python 更多的新特性和更高深的一些主题,比如在抽象基类、元类和修饰符等方面的 ......
Python中字符串被定义为引号之间的字符集合。Python支持使用成对的单引号或双引号,三引号包含的字符串。
使用索引操作符([])和切片操作符([:])可以得到子字符串。字符串有其特有的索引规则:第一个字符的索引是0
,最后一个字符的索引是-1。
加号(+)用于字符串连接运算,星号(*)则用于字符串重复。如下例:
pystr = " ......
[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, ......