We are currently trying to connect to a service using the West Wind WSDL Proxy Generator - the majority of which is working great, thanks.
One of the functions we're calling expects an object where one property is a string array.
We can create the string array without issues but are having trouble assigning that array as the property value - could you perhaps shed some light on where we're going wrong?
This is what we're trying, where loBridge has been created in the normal way. loParameterObject was created by the proxy generator (and is working fine with the Fox intellisense).
laStringArray = loBridge.CreateArray("System.String")
laStringArray.AddItem("Some string")
loParameterObject.ArrayProperty = laStringArray
we've also tried:
loBridge.SetProperty(loParameterObject, 'ArrayProperty', laStringArray)
We're getting a COM error - 0x8013150c which apparently is a SerializationException = 'A mismatch has occurred between the runtime type of the array and the sub type recorded in the metadata.'.
Many thanks in advance.
Richard
The second syntax should work. The first should definitely fail.
What is the .NET signature of the property you are trying to assign to? It has to be a string array, not a dictionary or collection or list in order for the array assignment to work. Otherwise you can use the .NET object methods to add values to the collection/list.
+++ Rick ---
Hi
We are currently trying to connect to a service using the West Wind WSDL Proxy Generator - the majority of which is working great, thanks.
One of the functions we're calling expects an object where one property is a string array.
We can create the string array without issues but are having trouble assigning that array as the property value - could you perhaps shed some light on where we're going wrong?
This is what we're trying, where loBridge has been created in the normal way. loParameterObject was created by the proxy generator (and is working fine with the Fox intellisense).
laStringArray = loBridge.CreateArray("System.String")
laStringArray.AddItem("Some string")
loParameterObject.ArrayProperty = laStringArray
we've also tried:
loBridge.SetProperty(loParameterObject, 'ArrayProperty', laStringArray)
We're getting a COM error - 0x8013150c which apparently is a SerializationException = 'A mismatch has occurred between the runtime type of the array and the sub type recorded in the metadata.'.
Many thanks in advance.
Richard
West Wind Technologies
Making waves on the Web
from Maui
From the .NET Reflector:
Public ArrayProperty As String()
which looks very much to me like it is a string array.
More from the disassembler:
<XmlArrayItem(Namespace:="http://schemas.microsoft.com/2003/10/Serialization/Arrays"), XmlArray(IsNullable:=True, Order:=2)> _
Public ArrayProperty As String()
Any ideas?
Thanks
Richard
Richard,
The second syntax should work. The first should definitely fail.
What is the .NET signature of the property you are trying to assign to? It has to be a string array, not a dictionary or collection or list in order for the array assignment to work. Otherwise you can use the .NET object methods to add values to the collection/list.
+++ Rick ---
Hi
We are currently trying to connect to a service using the West Wind WSDL Proxy Generator - the majority of which is working great, thanks.
One of the functions we're calling expects an object where one property is a string array.
We can create the string array without issues but are having trouble assigning that array as the property value - could you perhaps shed some light on where we're going wrong?
This is what we're trying, where loBridge has been created in the normal way. loParameterObject was created by the proxy generator (and is working fine with the Fox intellisense).
laStringArray = loBridge.CreateArray("System.String")
laStringArray.AddItem("Some string")
loParameterObject.ArrayProperty = laStringArray
we've also tried:
loBridge.SetProperty(loParameterObject, 'ArrayProperty', laStringArray)
We're getting a COM error - 0x8013150c which apparently is a SerializationException = 'A mismatch has occurred between the runtime type of the array and the sub type recorded in the metadata.'.
Many thanks in advance.
Richard
Please look at the C# view. It should be string[] or String[]...
And yes if that's the case the code you have should work. If it's not there's something else going on. Make sure that the base object that you're making the assignment on is created properly perhaps (always check for errors).
+++ Rick ---
Hi Rick
From the .NET Reflector:
Public ArrayProperty As String()
which looks very much to me like it is a string array.
More from the disassembler:
<XmlArrayItem(Namespace:="http://schemas.microsoft.com/2003/10/Serialization/Arrays"), XmlArray(IsNullable:=True, Order:=2)> _
Public ArrayProperty As String()
Any ideas?
Thanks
Richard
Richard,
The second syntax should work. The first should definitely fail.
What is the .NET signature of the property you are trying to assign to? It has to be a string array, not a dictionary or collection or list in order for the array assignment to work. Otherwise you can use the .NET object methods to add values to the collection/list.
+++ Rick ---
Hi
We are currently trying to connect to a service using the West Wind WSDL Proxy Generator - the majority of which is working great, thanks.
One of the functions we're calling expects an object where one property is a string array.
We can create the string array without issues but are having trouble assigning that array as the property value - could you perhaps shed some light on where we're going wrong?
This is what we're trying, where loBridge has been created in the normal way. loParameterObject was created by the proxy generator (and is working fine with the Fox intellisense).
laStringArray = loBridge.CreateArray("System.String")
laStringArray.AddItem("Some string")
loParameterObject.ArrayProperty = laStringArray
we've also tried:
loBridge.SetProperty(loParameterObject, 'ArrayProperty', laStringArray)
We're getting a COM error - 0x8013150c which apparently is a SerializationException = 'A mismatch has occurred between the runtime type of the array and the sub type recorded in the metadata.'.
Many thanks in advance.
Richard
West Wind Technologies
Making waves on the Web
from Maui