soaplib v2.0.0 HelloWorld
来源:互联网 发布:淘宝客推广在哪里设置 编辑:程序博客网 时间:2024/06/09 22:03
http://soaplib.github.io/soaplib/2_0/pages/helloworld.html
Declaring a Soaplib Service
import soaplibfrom soaplib.core.service import rpc, DefinitionBasefrom soaplib.core.model.primitive import String, Integerfrom soaplib.core.server import wsgifrom soaplib.core.model.clazz import Arrayclass HelloWorldService(DefinitionBase): @soap(String,Integer,_returns=Array(String)) def say_hello(self,name,times): results = [] for i in range(0,times): results.append('Hello, %s'%name) return resultsif __name__=='__main__': try: from wsgiref.simple_server import make_server soap_application = soaplib.core.Application([HelloWorldService], 'tns') wsgi_application = wsgi.Application(soap_application) server = make_server('localhost', 7789, wsgi_application) server.serve_forever() except ImportError: print "Error: example server code requires Python >= 2.5"
Calling this service
>>> from suds.client import Client>>> hello_client = Client('http://localhost:7789/?wsdl')>>> result = hello_client.service.say_hello("Dave", 5)>>> print result(stringArray){ string[] = "Hello, Dave", "Hello, Dave", "Hello, Dave", "Hello, Dave", "Hello, Dave", }
0 0
- soaplib v2.0.0 HelloWorld
- soaplib helloworld.py
- soaplib实现Webservice
- soaplib之usermanager
- soaplib之model?
- soaplib之binaryfile
- 用soaplib 创建 WebService
- soaplib webservices的hello world
- PHPMailer v2.0.0 新知
- 模板v2.0.0
- v2
- v2
- 在Win7上安装WINDRIVER.TORNADO.V2.2.FOR.PENTIUM与运行HelloWorld
- Linux v2.6内核编程之最简单的内核模块helloworld
- SOAP web service with soaplib 0.9+
- SOAP web service with soaplib 2.0
- Python开发WebService--使用soaplib库
- Python开发WebService--使用soaplib库
- Basic Level 1009. 说反话 (20)
- iOS 项目本地化
- MySQLdb For Python On Windows
- 题目1032:ZOJ
- GE SmallWorld开发(004加载SOMs)
- soaplib v2.0.0 HelloWorld
- JAVA中int、String的类型转换
- hdu 4183 Pahom on Water 网络流
- FROM子句
- Bochs使用[练习自己动手写操作系统]
- C中字符串处理
- [ACM] hdu 2602 Bone Collector(01背包)
- 【转】通过Python脚本自动发布ArcGIS服务
- Hadoop2.2.0伪分布式安装及测试笔记