GET HTTP and XML

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
2 posts • Page 1 of 1
marcel.gay@wimag.ch
Posts: 44
Joined: Thu May 07, 2015 4:55 pm

GET HTTP and XML

Post by marcel.gay@wimag.ch » Wed Mar 25, 2020 6:57 pm

I have to create a communication via http
first I have to send:
GET http://000.000.000.000:8118/sso-vs/sess ... [sessionid]

then I get back over the same http connection:

<?xml version="1.0" encoding="UTF-8"?>
<sessioninfo valid=[true/false)>
<username>String</username>
<grouptype name=String>
<scope>String</scope>
</grouptype >
<expiredAt>systemtime</expiredAt>
</session info>

I guess first I have to rmake an httpconnect()
When the treaty is finished, I close the http connection with httpdisconnect()
how do I send the "GET http ....."?
How can I intercept the xml string and evaluate the individual values ?

User avatar
adaneau
Posts: 202
Joined: Tue Feb 21, 2012 8:49 am

Re: GET HTTP and XML

Post by adaneau » Thu Mar 26, 2020 11:28 am

Hi,
NetGet is the function to send GET from WInCC OA to a web-service. No need to do httpConnect if you don't need to expose web-service from WinCC OA

Pity that your server reply is xml and not JSON. In this case you'll need to parse xml using xmlDocumentFromString function. Then you can use xmlNodeValue function to get any individual value knowing the key. Be careful I also see attributes in your sample so you may need xmlGetElementAttribute as well.

BR
Alexandre

Post Reply
2 posts • Page 1 of 1