LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic IP for web service VIs?

Hi,

 

I use the LabVIEW Web Service Import Wizard to build web service VIs. I was wondering if there is any method to dynamically specify the IP address of a web service server.

 

In our application development, usually we would setup an internal test server running web services. Once the development is finished, we would deploy the server with a new IP address. We'd then need to import the web services again and change the VI links in order for the new program to work. It would be nice if we can just change the server IP address instead.

 

Best Regards,
Chienwei
CWT

0 Kudos
Message 1 of 10
(13,167 Views)

Hi,Let's take an example from following website for reference:
http://zone.ni.com/devzone/cda/tut/p/id/4728 .
 
After GENERATting the .lvproj, Open the "Open Web Service.vi" file.
On the Block Diagram Window, we'll see one string blank containing the
URL we've  just copied from one of the connections in http://www.xmethods.net/ve2/Directory.po .
We can change that blank to "control" and assign this vi as a sub.
In that way, we could change our URL in our main VI front panel!

Following are 3 .jpg files for reference :

http://formosa.apac.corp.natinst.com/Operations/IS/nitwblog.nsf/Images/CTHG-7HW9UR/$File/1.JPG
http://formosa.apac.corp.natinst.com/Operations/IS/nitwblog.nsf/Images/CTHG-7HW9UR/$File/2.JPG
http://formosa.apac.corp.natinst.com/Operations/IS/nitwblog.nsf/Images/CTHG-7HW9UR/$File/3.JPG

 

NI AE Joe

0 Kudos
Message 2 of 10
(13,120 Views)

Hello ! Has anyone found a working solution to this problem yet ? The URL can be changed just like Joe explains, but at least for me this is not a solution. My application is Still trying to connect to the IP Address of the PC from where the Web Service methods were originally imported and it doesn't make difference if I feed another IP address into the url.

 

It seems the fixed IP Address was stored somehow directly into the WebServiceInterface.dll itself, when the Web Service was first imported.

 

I guess one workaround would be to install the LabVIEW into the same PC where the Web Service is located and import the Web Service there using "localhost" instead of IP Address. But this helps (? - haven't tried yet) only if I run my application on the server computers. If I install my application on some client PC the application is probably trying to connect to "localhost" and it won't work.

 

I wonder if this annoying problem has been fixed in 2010, or if there's another workaround ?

 

Best regards,

 

Cerati

0 Kudos
Message 3 of 10
(12,893 Views)

Hi Guys ,

 

Iam Also facing the same problem, any one got solution for the above case.

 

Regards,

 

 

Shrek

0 Kudos
Message 4 of 10
(12,710 Views)

Is this what you are trying to do?

0 Kudos
Message 5 of 10
(12,702 Views)

Shrek,

 

This bug was reported to NI last October. Unfortunately I don't know the CAR number nor the current status of this problem.

As far as I know, I think the problem still exists on LabVIEW 2011 -version.

 

The workaround I have been using is to do the Web Service -import for two different IP-addresses, one for the server use and another for the client use. Instad of IP-address I use the computer name ("localhost" for server and "someothername" for client use). This way two separate WebServiceInterface.dll -files are created and I can attach one of them to my application depending on if it's used on a server or a client computer. For the client use I also need to add the corresponding row into the hosts-file, located under system32/drivers/etc -folder.

 

Cheers,

 

Cerati

0 Kudos
Message 6 of 10
(12,674 Views)

Hi,

 

I'm facing the same issue with LV2012 SP1 !

Anyone of you finaly found a way to dynamically change the server IP on which the web service is pointing to ?

 

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 7 of 10
(12,375 Views)

I ran into the same problem myself.    

 

You can modify the HOSTS file (c:\Windows\System32\drivers\etc\HOSTS) with the same computer name used in the Web Services import, and then point to any IP address on the LAN.

 

HOSTS Entry:

192.168.0.21 MyPcName.MyCompanyName.com

 

I found that the name is hard-coded in the DLL library that is created from the WSDL import utility, and the only way to get around this is to modify the hosts file to point to whatever address has the web server running.

 

-GW

0 Kudos
Message 8 of 10
(12,084 Views)

Hi

 

I think have the same issue with LabVIEW 2017, can some one confirm that this issue still exists in LV2017?

 


0 Kudos
Message 9 of 10
(11,931 Views)

Hi,

I guess they didn't improve this toolkit over the years...

I found a work around working with SOAP requests over HTTP (SoapUI software prohram helped a lot).

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 10 of 10
(11,928 Views)