LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW converts a .NET - stringtype into an unusable refnum

I use the .Net Webservice browser to convert a WSDL-file from the local network into an assembly(DLL).
With a Invokenode one of the methods is selected. The return parameter was recognized as a boolean. The input was recognised as string (purple colour). But the resultvalue should also be a string. The outputline gets the symbol of a refnum with the value 'System.String&'.
My question: Is it possible to extract the string itself from the refnum-pointer or what did I do wrong?

//-------------------------------------------------------------------------
This is the C# function that is used at the production of the WSDL-file.
[WebMethod]
public bool GetParameter(string Key, out string Value)
{
bool bSuccess = true;
Value = "";
try
{
iTest.GetApplicationParameter(Key, out Value);
}
catch (Exception e)
{
Value = e.ToString();
bSuccess = false;
}
return bSuccess;
}

//-------------------------------------------------------------------------

Thanks
0 Kudos
Message 1 of 2
(2,264 Views)
No, you did the right thing. In LV 7.x the code couldn't handle the reference type directly inside of LV and so the reference was turned into a LV refnum. This has been changed in the next version.

The fastest solution is to create a little helper class that has a get/set property for a string reference. This would be a lot easier than the other solution I can think of, which is to call the reflection API directly.

The class would look something like

public static String GetString(ref String arg)
{
return arg;
}

public static void SetString(ref String arg, String newValue)
{
arg = newValue;
}
0 Kudos
Message 2 of 2
(2,257 Views)