LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Web Services, SOAP, 8.6 RT Target

Hello,

 

I have an application where I want to access information "served" on a standalone, networked, instrument. For this particular instrument you can get all the information I am looking for through a normal web browser or through a defined a set of web services using SOAP (Simple Object Access Protocol).

 

Using the web services approach is remarkably easy from LabVIEW on a PC - simply use tools>>Import>>Web Service... From here you can simply point to the Web Service Definition file (WSDL File) on the instrument and the import wizard creates a set of wrapper files that do all the work.

 

www.xmethods.net has a bunch of services listed - there is a (free) weather service that will give you a report and/or forecast for any city - I had fun playing with this! (In reality I cannot tell what protocol LV has chosen to use with this example - suffice to say that it works from the PC)

 

However, this operation is definitely not-so-easy from a RT Target - in fact, I simply don't know how to make it work at all!

 

My understanding is that 8.6 and RT lost support for some protocols (SOAP, etc.) to focus on RESTful. However, I'm unclear if this is just for services from a RT Target (server) rather than when a RT Target is acting as a client. In any case, in the above example the VI's created on the PC using the import wizard are based in .NET and not supported on a RT Target.

 

Now, it would seem to me that it would not be unreasonable to go low-level and create the desired communication with more basic building blocks - especially since for my particular application all I want to do is "get value X". Unfortunately, I'm totally new to this level of network protocol and am a little daunted...

 

Has anybody run into this before? I know there other instruments out there that use this kind of "server" approach - has anybody had to create their own interface to the HTML? Is there an example I'm just not finding? Are there SOAP workarounds for RT Targets?

 

Any suggests/examples very much appreciated!

 

0 Kudos
Message 1 of 4
(2,908 Views)

I'm sorry to say that you would have to do some work on implementing SOAP and HTTP in LV to get it to work on a RT target. We've done it ourselves by looking at the total HTTP request including SOAP message that the server requires. It can just be a string in which you have to replace some values. The server will respond with an HTTP response including the SOAP message response. From that SOAP message you can extract your requested value.

 

Bye the way you would have to open a TCP/IP connection to port 80 of the webservice server.

 

Once you have it up and running, it will continue to wor, so error checking can remain at the TCP/IP connection level. Or maybe check that the message is at least HTTP 200.

Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 4
(2,874 Views)

Hello André,

 

Thanks for the reply.

 

Are you suggesting that the way to do this is to see what the SOAP request looks like (as text?) and just parrot that through a normal TCP connection? Do you think this will this work from a RT Target?

 

It sounds plausible but that may be only because I know so little about low-level network communication.

 

Also, this device is publishing a "web page"  (http://xxx) - is there a way to use that directly?

 

All pointers appreciated...

Message Edited by Jolt on 04-09-2009 02:39 PM
0 Kudos
Message 3 of 4
(2,872 Views)
Yes this can be done on a RT target, because it supoort TCP/IP and string functions. That is all you need. For devices that publish a webpage you would have to send a HTTP request to the device requesting the published page. the response can then be parsed for the required values.  Have a look at the following document. Try "www.carya.nl" and path "/index.php" with HTTP GET and you'll get a response from the webserver.
Message Edited by andre.buurman@carya on 04-09-2009 09:52 PM
Regards,
André (CLA, CLED)
0 Kudos
Message 4 of 4
(2,869 Views)