Python web服务客户端

Python web服务客户端

问题描述:

任何人都可以从下面的JAX-WS API在python中创建web服务客户端吗?Python web服务客户端

https://109.231.73.12:8090/API?wsdl

正如我跑这是自签名的虚拟服务器的这一点。用户名和密码都是'querty123'

我们可以得到它在PHP中工作就好了不是Python。

所以工作的例子,说明您如何设法做到这将是巨大的

感谢

suds库使得这个在Python瞬间:

>>> from suds.client import Client 
>>> url = 'https://109.231.73.12:8090/API?wsdl' 
>>> client = Client(url, username='qwerty123', password='qwerty123') 
>>> client.service.addition(1, 2) 
3 
>>> client.service.hello('John') 
HelloJohn 
>>> client.service.xToThePowerOfy(2, 16) 
18 
>>> print client # automagic documentation 

Suds (https://fedorahosted.org/suds/) version: 0.4 (beta) build: R685-20100513 

Service (BasicService) tns="http://service.basic.com/" 
    Prefixes (1) 
     ns0 = "http://service.basic.com/" 
    Ports (1): 
     (BasicPort) 
     Methods (3): 
      addition(xs:int x, xs:int y,) 
      hello(xs:string name,) 
      xToThePowerOfy(xs:int x, xs:int y,) 
     Types (6): 
      addition 
      additionResponse 
      hello 
      helloResponse 
      xToThePowerOfy 
      xToThePowerOfyResponse