# What is the alternative to SUDS?

**URL:** <https://forum.inductiveautomation.com/t/what-is-the-alternative-to-suds/17593>\
**Category:** Ignition\
**Tags:** scripting, ignition79\
**Created:** [April 4, 2018, 3:02am UTC](https://forum.inductiveautomation.com/t/what-is-the-alternative-to-suds/17593 "2018-04-04T03:02:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [April 4, 2018, 3:02am UTC](https://forum.inductiveautomation.com/t/what-is-the-alternative-to-suds/17593/1 "2018-04-04T03:02:41Z")

</div>

I used to use SUDS to retrieve data from Web services, but now that it’s no longer included with Ignition, and development.

Is anyone out there using an alternative to SUDS?

What are my options?

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [April 4, 2018, 5:51am UTC](https://forum.inductiveautomation.com/t/what-is-the-alternative-to-suds/17593/2 "2018-04-04T05:51:58Z")

</div>

It’s quite easy to use plain HTTP requests and parse the XML with python. If you know the format.

Otherwise, I believe SUDS is a pure-python module, so you can install it yourself by placing the module in `user-lib/pylib` in your ignition install directory.

---

<div class="post-metadata">

**Author:** ![Paullys50](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paullys50/32/3324_2.png) [@Paullys50](https://forum.inductiveautomation.com/u/Paullys50)\
**Post date:** [April 4, 2018, 12:26pm UTC](https://forum.inductiveautomation.com/t/what-is-the-alternative-to-suds/17593/3 "2018-04-04T12:26:09Z")

</div>

SUDS is just a python module module as Sanderd17 mentioned, unfortunately that module seemed pretty much dead when I tried to use it last year. Original documentation pretty much said so and look for a fork of it. I had trouble getting it to work 100% with an ERP web service and due to time constraints and lack of good documentation for it I splurged and picked up the Sepasoft Web Services module and use that instead.

However my google-fu got me:

[https://bitbucket.org/jurko/suds/wiki/Original%20Documentation](https://bitbucket.org/jurko/suds/wiki/Original%20Documentation)

So looks like someone recently brought some life back into SUDS, well at least the documentation.

I’m happy with the Sepaosft Module, the original version of it was clearly just a SUDS wrapper to make it easy to configure from Ignition, but the latest module looks to be built from the ground up. I did run into an issue with the Sepasoft module and trying to connect to an ERP web service that was configured with nested WSDL files. I wouldn’t call it a Sepasoft issue at all, really a change in .NET programming and Java compatibility as I understand it. As long as you get a single WSDL with all definitions it works great.

---

<div class="post-metadata">

**Author:** ![R.Alamsha](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@R.Alamsha](https://forum.inductiveautomation.com/u/R.Alamsha)\
**Post date:** [April 4, 2018, 3:28pm UTC](https://forum.inductiveautomation.com/t/what-is-the-alternative-to-suds/17593/4 "2018-04-04T15:28:36Z")

</div>

**Parsing XML with the Etree Library:**  
[https://docs.inductiveautomation.com/display/DOC79/Parsing+XML+with+the+Etree+Library](https://docs.inductiveautomation.com/display/DOC79/Parsing+XML+with+the+Etree+Library)

---

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [April 4, 2018, 11:11pm UTC](https://forum.inductiveautomation.com/t/what-is-the-alternative-to-suds/17593/5 "2018-04-04T23:11:04Z")

</div>

Thank you all for your suggestions.

@Sanderd17:  
In the past I have copied the suds folder, but I worry about compatibility with future releases.

Would you care explaining how to use plain HTTP requests against a Web service?

@Paullys50:  
Thank you, but a $3,500 USD module is not exactly the solution I’m currently seeking.

@R.Alamsha  
How would you use the Etree library to call a Web service method?

---

<div class="post-metadata">

**Author:** ![Paullys50](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paullys50/32/3324_2.png) [@Paullys50](https://forum.inductiveautomation.com/u/Paullys50)\
**Post date:** [April 4, 2018, 11:29pm UTC](https://forum.inductiveautomation.com/t/what-is-the-alternative-to-suds/17593/6 "2018-04-04T23:29:27Z")

</div>

> [@cesrom](#):
>
> Thank you, but a $3,500 USD module is not exactly the solution I'm currently seeking.

Understandable but you did ask for an alternative, and with the module you'll have it working in a fraction of the time. As I said my luck with SUDS was no bueno (would throw schema errors which I believe was due to a problematic WSDL from the ERP system) and I couldn't find an obvious 'free' alternative to SUDS.

The link I provided takes you to what you need to get started so you can try SUDS and see if it does what you need.

> [@cesrom](#):
>
> How would you use the Etree library to call a Web service method?

Etree doesn't call a web service, it just allows you to parse the related XML should you need to decode a result from the web service.

Do you have to pull data from the Web Service? Or publish data to the Web Service?

---

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [April 4, 2018, 11:47pm UTC](https://forum.inductiveautomation.com/t/what-is-the-alternative-to-suds/17593/7 "2018-04-04T23:47:14Z")

</div>

Pull data from a Web service.

I have an application using SUDS, and it is working just fine. I do remember I was experiencing a problem with the WSDL, so I switched to the Single WSDL.

The service I am using offers these two options:  
`http://server/dataservice/service.svc?wsdl`  
and  
`http://server/dataservice/service.svc?singleWsdl`

Using the latter solved whatever problem I was having, by calling the desired method like this:

```auto
from suds.client import Client
client = Client('http://server/dataservice/service.svc?singleWsdl')
result = client.service.Method(param1, param2, ...)

```

---

<div class="post-metadata">

**Author:** ![R.Alamsha](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@R.Alamsha](https://forum.inductiveautomation.com/u/R.Alamsha)\
**Post date:** [April 5, 2018, 5:43am UTC](https://forum.inductiveautomation.com/t/what-is-the-alternative-to-suds/17593/8 "2018-04-05T05:43:44Z")

</div>

> [@cesrom](#):
>
> I do remember I was experiencing a problem with the WSDL, so I switched to the Single WSDL.

Can you pull the data as JSON and process it further?.

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [April 5, 2018, 6:06am UTC](https://forum.inductiveautomation.com/t/what-is-the-alternative-to-suds/17593/9 "2018-04-05T06:06:11Z")

</div>

I’ve used SoapUI before to examine a SOAP wsdl: [https://www.soapui.org/](https://www.soapui.org/)

Basically, when you call a SOAP function, it sends a HTTP request like `server/path/to/soapInstallation/SoapFunction?Param1=xxx&Param2=yyy` SoapUI should show you the correct url to query.

You can directly call this using the httpGet method (including authentication): [https://docs.inductiveautomation.com/display/DOC/system.net.httpGet](https://docs.inductiveautomation.com/display/DOC/system.net.httpGet)

Then usually, the answer is an XML document, which you can parse with Etree or any other XML parser in pure python.

Another note on the compatibility on SUDS: it will work as long as Ignition keeps using Python 2.x. Given that Jython doesn’t even have a 3.x version released, I assume it will still be usable a few decades.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 5, 2018, 11:57am UTC](https://forum.inductiveautomation.com/t/what-is-the-alternative-to-suds/17593/10 "2018-04-05T11:57:09Z")

</div>

> [@Sanderd17](#):
>
> Given that Jython doesn't even have a 3.x version released

I hope to help change that, with my copious free time... /-:

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 5, 2018, 12:03pm UTC](https://forum.inductiveautomation.com/t/what-is-the-alternative-to-suds/17593/11 "2018-04-05T12:03:08Z")

</div>

> [@pturmel](#):
>
> with my copious free time...

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9b1d813a4bb51be357a16cefaa43a887442652c8.png)

... that's how I feel about my "free time", anyway ...

---

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [April 5, 2018, 10:16pm UTC](https://forum.inductiveautomation.com/t/what-is-the-alternative-to-suds/17593/12 "2018-04-05T22:16:57Z")

</div>

After playing around with SoapUI I was able to get the SOAP envelope for my POST request, which in turn I used as a parameter for the `system.net.httpPost` method.

I got the headers by looking at the Raw representation of the SOAP request in SoapUI.

Here is my sample code in case anyone may be interested:

```auto
dataservice = 'http://webserver/dataservice/service.svc'
soapenv = u"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:Method>
         <!--Optional:-->
         <tem:param1>test</tem:param1>
      </tem:Method>
   </soapenv:Body>
</soapenv:Envelope>"""

headers = {
	'Content-Type': 'text/xml;charset=UTF-8',
	'SOAPAction': 'http://tempuri.org/service/Method',
	'Content-Length': len(soapenv),
	'Host': 'webserver',
	'Connection': 'Keep-Alive',
	'User-Agent': 'Ignition'
}

response = system.net.httpPost(url=dataservice, contentType='text/xml', postData=soapenv, headerValues=headers)

```

In this example the `response` variable will hold the XML response from the Web service.

Cheers!
