Thread

Skip Navigation LinksForums > SpiraTest Forums > SpiraTest Issues & Questi... > How to access Spira v3.x ...

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

Thursday, October 17, 2013
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
Adam SAdam S
re: nilesh g on Thursday, October 17, 2013
Friday, October 25, 2013

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

Maxim CournoyerMaxim Cournoyer
re: Adam S on Friday, October 25, 2013
Thursday, July 17, 2014
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)

Tagged
Statistics
  • Started: 10/17/2013
  • Last Reply: 7/17/2014
  • Replies: 2
  • Views: 1107
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2016 | Licensed to Inflectra Corporation.