# Wsdl/soap/xml

**URL:** <https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625>\
**Category:** General Discussion\
**Created:** [June 13, 2012, 3:53pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625 "2012-06-13T15:53:00Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [June 13, 2012, 3:53pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/1 "2012-06-13T15:53:00Z")

</div>

I was hoping someone could point me in the right direction for some topics that discuss how to use this in Ignition. I have hopefully found a solution for a lighting controls problem and it involves the purchase of a SOAP/XML interface from Eaton/Cutler-Hammer. i am hoping this is the avenue for getting their data into Ignition. Any Information would be helpful on how to start using the WSDL.  
[SOAP manual.pdf](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4d8090c142d06a657b11ad5dbe67f5b0e4e6577b.pdf) (367 KB)

---

<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:** [June 13, 2012, 4:18pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/2 "2012-06-13T16:18:09Z")

</div>

As of 7.4, the SUDS Python library is accessible through scripting: [fedorahosted.org/suds/](https://fedorahosted.org/suds/) ![:thumb_right:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/2026e28c0c425034352c1b75807edf956adc75f4.gif ":thumb\_right:")

Read up ![:thumb_right:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/2026e28c0c425034352c1b75807edf956adc75f4.gif ":thumb\_right:")

---

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [August 14, 2012, 8:59pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/3 "2012-08-14T20:59:34Z")

</div>

Can anybody suggest good documentation/examples of using the system.net.httpPost,  
Example 2 from the manual is not quite cutting it.

“Code that sends an XML message to hypothetical url”  
OR  
actual examples of using Ignition with wsdl type service?

Attached is a file with message/response transaction that I need to be in alignment with.

None of the syntax I have tried, has worked.  
I have tried import suds and xml.dom.minidom.

I really need to get to calif. for that advanced training…  
ANY HELP appreciated  
[SOAP XML INFO.txt](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/8b094e039bccc5a3b40be0bb28723fce373e6d04.txt) (4 KB)

---

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [August 14, 2012, 9:28pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/4 "2012-08-14T21:28:10Z")

</div>

some recent test screen shots and error logs.  
[test 1 error text.txt](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/57e551c1daaf8cdd62e3a4f4bfc218fb8ada1e4a.txt) (2 KB)

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

---

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [August 14, 2012, 9:37pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/5 "2012-08-14T21:37:53Z")

</div>

also attached wsdl file/ change from txt to wsdl extension  
[HISService TEXT.txt](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/747d9d6faa1fc3f0c0626a64259c442a353e9530.txt) (9.5 KB)

---

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [August 15, 2012, 4:26am UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/6 "2012-08-15T04:26:14Z")

</div>

OK, I have done a small test 2 different ways.  
I have been trying to pass the data to the wsdl’s method through a tag. I have changed the data type of the tag to multiple variants. I also tried the formatted text field. I need some help finding the true data that is being sent to the wsdl service through Ignition. Attached are two screenshots. Both have test results in a label. 1) trying to pass data to wsdl through script. 2) passing data to wsdl ‘hard coded’. I am not sure how to satisfy the requirement of the wsdl nor what ‘data type’ it actually requires. I could be missing a fundamental concept, I am not sure. The drop-down list/formatted text box are all testing optional, I was trying various methods to ‘see’ my 5 digits  
Anyones help or advice appreciated.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b0d71c2f5c80540fa685be84d492bcf6f8dd7598.PNG)  
  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/3024f841932d7b02ebc56e758c6463cd63382ea5.PNG)

---

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [August 15, 2012, 4:42pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/7 "2012-08-15T16:42:15Z")

</div>

I did a small breakdown of the wsdl file using xml spy. Document attached.  
[HISService.doc](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a2094265ffcd8665f2cfd5a2c7fce9f846069028.doc) (228 KB)

---

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [August 16, 2012, 7:56pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/8 "2012-08-16T19:56:40Z")

</div>

I have been able to communicate with a web service using suds by “hard coding” the script in the event handler. I still cannot seem to pass a method argument to the wsdl via an ignition tag. But I can write the response to a tag… Seems I am missing something…I have this working just not the way that it could. Is there anybody out there at all that has used the suds implementation?  
Any help advice appreciated…

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

---

<div class="post-metadata">

**Author:** ![dave.fogle](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@dave.fogle](https://forum.inductiveautomation.com/u/dave.fogle)\
**Post date:** [August 16, 2012, 9:36pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/9 "2012-08-16T21:36:38Z")

</div>

You look really close to getting the first piece of the info you want back. Try this:

```python
import suds
url = "http://www.webservicemart.com/uszip.asmx?WSDL"
client = suds.client.Client(url)
zip_to_validate = system.tag.getTagValue("tag to wsdl")
result = client.service.ValidateZip(zip_to_validate)
system.tag.writeToTag("tag from wsdl",result)
```

The only part you seemed to be missing was the system.tag.getTagValue() call. If you're using 7.5 you can use system.tag.read() instead. It does the same thing but looks nicer and is easier to type 🙂

---

<div class="post-metadata">

**Author:** ![AlThePal](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/althepal/32/3603_2.png) [@AlThePal](https://forum.inductiveautomation.com/u/AlThePal)\
**Post date:** [August 17, 2012, 8:06pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/10 "2012-08-17T20:06:22Z")

</div>

Just to avoid frustration, remember that system.tag.read returns a qualified value object, not a value. If you want to change you code to use system.tag.read you’ll have to type`zip_to_validate = system.tag.read("tag to wsdl").value`

---

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [August 18, 2012, 3:19pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/11 "2012-08-18T15:19:41Z")

</div>

![:thumb_left:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e26afb081ddde6df016df6ee49159cf56aaca688.gif ":thumb\_left:") thank you, if it wasnt for this forum and w3schools, and stackoverflow , frustrations  
would be monumental. I know how much I would benefit from the advanced training, I just cant make  
it back to cali right now.

---

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [August 20, 2012, 4:10pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/12 "2012-08-20T16:10:24Z")

</div>

The WSDL through suds does work. Thanks guys for improving my syntax!!!  
Thought I would post a link to my next course of action:  
[docs.python.org/release/2.6.8/li … -xmlrpclib](http://docs.python.org/release/2.6.8/library/xmlrpclib.html?highlight=xmlrpc#module-xmlrpclib)

The soap/xml server that I am working with uses ‘RPC’ styel where each operation acts like a function with in and out parameters.

---

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [August 20, 2012, 5:11pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/13 "2012-08-20T17:11:58Z")

</div>

import xmlrpclib  
import pprint  
import suds  
from pprint import pprint  
import httplib  
host = ‘[http://10.213.135.22:80](http://10.213.135.22:80)’  
h = httplib.HTTP(host)  
h.putrequest(‘POST’, ‘/soap HTTP/1.1’)  
h.putheader(‘Content-Type’, ‘text/xml’)  
h.putheader(‘Accept’, ‘text/\*’)  
h.putheader(‘User-agent’, ‘HTTP HIS’)  
h.putheader(‘Host’, host)  
h.putheader(‘Content-Length’, ‘300’)  
h.putheader(‘Cache-Control’, ‘no-cache’)  
h.putheader(’\<?xml version="1.0" encoding="utf-8"?\>’)  
h.putheader(’\<soap:Envelope xmlns:xsi=“[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)” xmlns:xsd=“[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)” xmlns:soap=“[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)”\>’)  
h.putheader(‘soap:Body’)  
h.putheader(’\<n:siireq xmlns:n=“urn:HISolutions”\>’)  
h.putheader(’\</n:siireq\>’)  
h.putheader(’\</soap:Body\>’)  
h.putheader(’\</soap:Envelope\>’)

h.endheaders()  
returncode, returnmsg, headers = h.getreply()  
if returncode == 200:  
f = h.getfile()  
print f.read()

---

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [August 20, 2012, 5:12pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/14 "2012-08-20T17:12:25Z")

</div>

Traceback (most recent call last):  
File “”, line 24, in   
File “C:\Documents and Settings\tjtwitty\Local Settings\Application Data\Sun\Java\Deployment\cache\FPMI\script\_lib2\Lib\httplib.py”, line 860, in endheaders  
self.\_send\_output()  
File “C:\Documents and Settings\tjtwitty\Local Settings\Application Data\Sun\Java\Deployment\cache\FPMI\script\_lib2\Lib\httplib.py”, line 732, in \_send\_output  
self.send(msg)  
File “C:\Documents and Settings\tjtwitty\Local Settings\Application Data\Sun\Java\Deployment\cache\FPMI\script\_lib2\Lib\httplib.py”, line 699, in send  
self.connect()  
File “C:\Documents and Settings\tjtwitty\Local Settings\Application Data\Sun\Java\Deployment\cache\FPMI\script\_lib2\Lib\httplib.py”, line 666, in connect  
for res in socket.getaddrinfo(self.host, self.port, 0,  
File “C:\Documents and Settings\tjtwitty\Local Settings\Application Data\Sun\Java\Deployment\cache\FPMI\script\_lib2\Lib\socket.py”, line 754, in getaddrinfo  
raise \_map\_exception(jlx)  
socket.gaierror: (20001, ‘getaddrinfo failed’)

---

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [August 20, 2012, 5:13pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/15 "2012-08-20T17:13:27Z")

</div>

I may be getting somewhere/no-where. At least my errors have changed.

---

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [August 20, 2012, 9:16pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/16 "2012-08-20T21:16:42Z")

</div>

update-- found out today that the little device i was trying to comm with doesnt really have a wsdl. it uses xml  
messages. i started testing httppost

---

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [August 23, 2012, 8:16pm UTC](https://forum.inductiveautomation.com/t/wsdl-soap-xml/4625/17 "2012-08-23T20:16:39Z")

</div>

[xml.com/pub/a/2003/03/10/python.html](http://www.xml.com/pub/a/2003/03/10/python.html)

[xml.com/pub/a/2002/09/25/py.html?page=2](http://www.xml.com/pub/a/2002/09/25/py.html?page=2)

Still trying…
