How to access Spira v3.x SOAP web services using Python ?

Thursday, October 17, 2013 6:50:08 AM
I have to access SpiraTest SOAP web service for python.

So, Can I get knowledge base code for SOAP service for Spiratest using Python ?
2 Replies
Friday, October 25, 2013 7:18:19 PM
Avatar
re: nilesh on Thursday, October 17, 2013 6:50:08 AM

Hi Nilesh

You would use something like:

from suds.client import Client
from suds.xsd.doctor import Import, ImportDoctor
from suds.wsse import *

WDSLFile = http://mySpiraServer.com/SpiraTeam/Services/v4_0/ImportExport.svc?wsdl
client = Client(WDSLFile,doctor=schema_doctor)
resp = client.service.Connection_Authenticate("myUsername","myPassword")

Regards

Adam

Thursday, July 17, 2014 7:56:58 PM
Avatar
re: inflectra.adam on Friday, October 25, 2013
It seems the answer provided by Adam is incomplete (where is that schema_doctor variable defined?) but at least it pointed me to the right place: http://stackoverflow.com/questions/3760427/problem-accessing-wsdl-service-with-python-suds-raises-typenotfound-arrayofint

For reference, here is a re-transcript of the solution:
from suds.client import Client
from suds.xsd.doctor import Import, ImportDoctor

# Obviously I made this up    
wsdl_url = 'http://whatever/path/to/wsdl'

# Fix missing types with ImportDoctor
schema_url = 'http://schemas.microsoft.com/2003/10/Serialization/Arrays'
schema_import = Import(schema_url)
schema_doctor = ImportDoctor(schema_import)

# Pass doctor to Client
client = Client(url=wsdl_url, doctor=schema_doctor)

Statistics
  • Started: Thursday, October 17, 2013 6:50:08 AM
  • Last Reply: Thursday, July 17, 2014 7:56:58 PM
  • Replies: 2
  • Views: 1248