2010-07-13 16 views
6

Qualcuno può creare un client Webservice in python dalla seguente API JAX-WS?Client webservice Python

https://109.231.73.12:8090/API?wsdl

come sto correndo questo di un server virtuale è auto firmato. Sia il nome utente che la password sono 'querty123'

Possiamo farlo funzionare in php, non proprio python.

Così un esempio di lavoro che spiega come è riuscito a farlo sarebbe grande

Grazie

risposta

5

La biblioteca suds rende questo un gioco da ragazzi in 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