ThomasGutzler Posted July 26, 2015 Report Share Posted July 26, 2015 I haven't done much with vi scripting, so I might have thrown myself into the deep end here, but this is it: Is it possible to create a new web service in my existing project and then do all the configuration via scripting too? Or can I create a web service from template so that I don't have to do all the configuration in scripting? I tried googling but all results were for scripting *in* web services. Quote Link to comment
MikaelH Posted July 27, 2015 Report Share Posted July 27, 2015 Try this: ...or start hacking the project XML file: //Mike Quote Link to comment
smithd Posted July 27, 2015 Report Share Posted July 27, 2015 I haven't done much with vi scripting, so I might have thrown myself into the deep end here, but this is it: Is it possible to create a new web service in my existing project and then do all the configuration via scripting too? Or can I create a web service from template so that I don't have to do all the configuration in scripting? I tried googling but all results were for scripting *in* web services. I put together something which imports a web service into your project from a template. Its really hacky and may not work for all web services (in fact it no longer works for the web service I originally wrote it for, although I plan to fix that at some point). The code is on this download page: https://decibel.ni.com/content/docs/DOC-38927 Specifically ni_cvt_web_addon-1.6... I'd just unzip it and open the vi ni_cvt_web_addon-1.6.0.1\File Group 0\project\AddCVTWebServiceToProject.vi Also, be sure not to judge me based on that code. Quote Link to comment
ShaunR Posted July 27, 2015 Report Share Posted July 27, 2015 (edited) Also, be sure not to judge me based on that code. No release, no judgement. You've released...Doh! Edited July 27, 2015 by ShaunR Quote Link to comment
smithd Posted July 27, 2015 Report Share Posted July 27, 2015 Oh well Edit: Was just looking back through it and I remembered all the issues I had getting it to work at all. Things like guids and paths just didn't get set as I would expect. You can always dig through some of the other code in the same directory, but its pretty hard to understand what the different functions are doing. Quote Link to comment
ThomasGutzler Posted July 27, 2015 Author Report Share Posted July 27, 2015 Try this: WebService.png Of course, I had gotten that far and then looked at the help which didn't list "Web Service" under Type. The part that the list only contains the *most common* types I had completely ignored ... Also loving the "Get All Descendents" method. With its help I was able to figure out how to get hold of the automatically created sub folders of the Web Service and how to add items to them. A quick look at the project file revealed some missing properties, which I decided to set using "Set Tag". I'm assuming that's the correct, and only way? <Property Name="ws.buffered" Type="Bool">true</Property> Quote Link to comment
MikaelH Posted July 28, 2015 Report Share Posted July 28, 2015 Just remeber to save the project as well ;-) I have seen in the past that if you write a Tag Value and then read it later the Tag Value could read the old value, even if the project is saved and the Tag value in the XML file has been updated. So in some instances I actually open and parse the XML file, just to be sure. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.