LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Importing WSDL from Windows Communication Foundation (WCF)

Hi Maciej

Thanks so much for your  prompt reply. I'm still a bit confused however. I have now managed to get LV talking to my WCF service by placing the .dll and .config files in the LV project file directory. However, i think i may be overcomplicating things due to my lack of LV knowledge (i'm a .net developer usually!) . If i can just sanity check what i have done to make sure i am not making any glaring errors.

  • I have created a WCF SOAP service, hosted in IIS accessed via a .svc file.
  • I need LV to talk to this service over http.
  • I tried to import the WSDL but then found out LV does not like WCF : (
  • I used svcutil to generate a proxy class and a config file from the WSDL
  • I created a VS2008 assembly project, added the proxy class and config file (copied into app.config)
  • I then added a second (public) class that uses the generated proxy class to invoke the service methods.
  • I then built the dll.


This is the dll i then used in LV via the .Net connect node etc. and called the methods on my public class to get information from the service. However, this seems like a really clunky way of doing this and means i have to write wrapper methods for ever method on my service....

 

I am probably doing this all wrong...can LV use the generated proxy class directly without having to create a wrapper class? Boy, i'll be glad when i can just point LV at teh WCF WSDL....

 

thanks for your help

jamie

 

 

 

 

 

 

0 Kudos
Message 21 of 27
(2,116 Views)

Hi,

 

You would like to take the information that svcutil.exe puts into the output.config file, and make LV aware of it, and use it.

This I'm affraid cannot be done, out of the box. Becaouse LV it self does not know how to read in .NET confg files in, at least I'm not aware of such feature. I have an idea for a workaround but I'll get to that in the end of the post.

 

So that we have a common understanding.

The configuraiton file that svcutil.exe outputs for you is not the config file for the client.dll file you get.

It is for that upper level, assembly that will be the application that imports the client as a dll. And it is there to simplify your usage of the WCF service.

So that when you create a client object, you can use the default constructior.And it will construct a client for you based on the config file infromation.

 

You can do two things.

 

1) That proxy class that you had mentioned. I would suggest that you use LV to implement what this class does, by using the information about the binding, and the endpointadress inside your LV code. ( Just like I have done in the example I mentioned in the previous post ).

Here you would construct the client not based on the default constuructor that takes no arguments, but you would have to choose a binding, and enpoint adress yourself.

2) Figure out a way to create the client by the proxy class that is .NET derived. And pass the Client Object reference to LabVIEW once the client object is constructed. Than use LV to work on that reference.

 

Option number two I had not thought through thoroghly... on how to exactly implement this, but  I need to get back to doing stuff I get paid for 🙂

 

Anyway, if your configuration file isn't very very complicated and does not have tons of security / complicated configuration in it I would suggest you take option number one. And create the proxy within LabVIEW. This way once you construct the client object you will be able to call any method your Web Service provides.

 

Hope this helps,

Maciej

 


0 Kudos
Message 22 of 27
(2,103 Views)

Thanks Maciej for your help on this.

I'll let you know how i get on.

 

 

Message Edited by Jamiew on 08-02-2009 04:58 PM
0 Kudos
Message 23 of 27
(2,084 Views)

Hi NI

 

Is there any progress in this issue? Many developers seem to have stumbled into this problem with lack of support for the modern version of web services. Having to go take the long way round with Visual Studio is not a very graphical solution.

 

I am using LabVIEW 2011.

 

 

Best regards

Michael

 

0 Kudos
Message 24 of 27
(1,464 Views)

Michael,
This was reported to R&D (# 35788), but the decision has been made not to change the product. If you feel strongly about this, you can request that an update be posted to the CAR, requesting the problem be reconsidered. I hope this helps.

Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 25 of 27
(1,447 Views)

I'm with Michael. 

 

Jared, how do we request an update be made to the CAR?  I just learned of LabVIEW's ability to import Web Services and was stoked to think of the possibilities it opens up.  Immediately, I was crushed because every service I tried to test with was WCF.  LabVIEW needs this feature! 

 

...Ben

0 Kudos
Message 26 of 27
(1,357 Views)

Ben,

 

Feel free and post this idea on our LabVIEW Idea exchange. This discussion forum is regularly viewed by R&D and this is the best platform for customers to have a say in what changes are made to our products.

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 27 of 27
(1,345 Views)