06-15-2013 03:34 PM
Hi,
I'm not quite sure is the problem connected to WebServices import function. But to present full picture I explain what I did.
Using Import WebServices in LV2012SP1 I created a library to do the job. I saved the library for LV2011 then. It works fine (discovering and connectig to the WebService etc).
But,
When I execute the web service which should return an array of objects (definied in the service, C# class) instead of seeing expected array of clusters I see ann array of references. Why?
It works perfectly when the output is one, singular object, not an array. Then the cluster is returned.
Solved! Go to Solution.
06-15-2013 04:08 PM
LV can't convert .NET objects to clusters directly. I think you have to do the conversion manually by reading the properties of each .NET object in the array and storing them as cluster (maybe you have to cast the .NET object to the appropriate type before you're able to read its properties). A guess why it works an non-array type: Maybe a mapping is created between the properties of the .NET objects and the fields of the cluster during import.
06-16-2013 10:08 AM
I think it does, unless the object is an array.
In my case, there is no problem with the auto converting class to cluster.
06-16-2013 11:17 AM
As said before, I think this cluster conversion is done via creating a mapping during import. But that might not even be important. AFAIK the array object lacks type information and is treated as an array of System.Object . If that's the case LV can't know how to convert these references.
06-21-2013 09:23 AM
Ok,
Despite the fact that we have different opinions about the array and not array variables your post has helped me and pointed in the right direction. Thanks.
Now my code does what I want.