SOAP APIs with Python

Hi All,

After being unsuccessful with SOAP API calls in UiPath and consulting colleagues, I decided to try and doing it in Python with the following code.

import requests

def convertNumbersToWordsSOAP(Number)
    url = ""
    headers = {'Content-Type': 'text/xml'}
    body = """<?xml version="1.0" encoding="utf-8"?>
            <soap:Envelope xmlns:soap="">
                    <NumberToWords xmlns="">
                        <ubiNum>""" + Number + """</ubiNum>
    response =, data=body, headers=headers, timeout=8)
    return str(response.content)

Please note that the above code works when I run it in outside of UiPath. It is a public SOAP API that you send digits and it returns the digits in words.

I have been able to get very basic Python scripts working in UiPath but this one is giving me a hard time. I get a Load Python Script: The specified script file was not found error.

How can I fix this?