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

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 ?
3 Replies
Friday, October 25, 2013
re: nilesh Thursday, October 17, 2013

Hi Nilesh

You would use something like:

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

WDSLFile =
client = Client(WDSLFile,doctor=schema_doctor)
resp = client.service.Connection_Authenticate("myUsername","myPassword")



Thursday, July 17, 2014
re: inflectra.david 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:

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

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

# Fix missing types with ImportDoctor
schema_url = ''
schema_import = Import(schema_url)
schema_doctor = ImportDoctor(schema_import)

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

Friday, May 5, 2023
re: nilesh Thursday, October 17, 2013

SOAP stands for Simple Object Access Protocol, as the name suggests nothing but a protocol for exchanging structured data between nodes. It uses XML instead of JSON.

In this article, we are going to see how to make SOAP API calls using python. If you want to test out what exactly the payload and response would look like, you can use the below curl command:


Method 1: Using a request

First, we import the requests library, then we define the SOAP URL. 


The next and most important step is to format the XML body according to the structure provided in the SOAP URL. To know the format, simply visit the SOAP URL, click the CountryISOCode link, and format the XML accordingly.

Then you simply prepare the headers and make the POST call.


import requests
# SOAP request URL
url = ""
# structured XML
payload = """<?xml version=\"1.0\" encoding=\"utf-8\"?>
            <soap:Envelope xmlns:soap=\"\">
                    <CountryIntPhoneCode xmlns=\"\">
# headers
headers = {
    'Content-Type': 'text/xml; charset=utf-8'
# POST request
response = requests.request("POST", url, headers=headers, data=payload)
# prints the response

The web service domain is defined in an XML schema file (XSD) that Spring-WS will automatically export as a WSDL. Create an XSD file with operations to return a country‚Äôs name, population, capital, and currency.  For more details about the course check out this link learn selenium includes all topics of Selenium such as Features, Selenium vs QTP, Selenium Tool Suits, Selenium IDE, Selenium IDE Locating Strategies, Selenium WebDriver, WebDriver Features, WebDriver vs RC, WebDriver Installation, etc.

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885


  • Started: Thursday, October 17, 2013
  • Last Reply: Friday, May 5, 2023
  • Replies: 3
  • Views: 9728