Web Service Proxy Generator
wwDotNetBridge with string arrays
Gravatar is a globally recognized avatar based on your email address. wwDotNetBridge with string arrays
  n/a
  All
  Nov 26, 2014 @ 09:36am
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

Gravatar is a globally recognized avatar based on your email address. Re: wwDotNetBridge with string arrays
  Rick Strahl
  Richard Bourne
  Nov 26, 2014 @ 01:39pm
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



Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Gravatar is a globally recognized avatar based on your email address. Re: wwDotNetBridge with string arrays
  n/a
  Rick Strahl
  Nov 27, 2014 @ 02:26am
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



Gravatar is a globally recognized avatar based on your email address. Re: wwDotNetBridge with string arrays
  Rick Strahl
  Richard Bourne
  Nov 27, 2014 @ 02:44am

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






Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

© 1996-2024