views:

17

answers:

1

I have a web service which has a method with parameter of type Collection( of Byte). When i try to generate the proxy using the wsdl command but the datatype gets converted to single dimensional Array of Bytes.

So i thought of creating the wsdl file which will have the type as Collection(of byte) using Add as Service Reference, but even though i specify collection type as Collection.objectModel still the parameter has the datatype as single dimensional Array of Bytes.

Is there any way to do this, or manual do i need to change in the proxy file.?

A: 

You need to specify the collection type:

svcutil /t:code /ct:System.Collections.Generic.List`1

Full SvcUtil documentation here.

jrista
I did try that by using Add Service Reference in Advanced option,but still in wdsl the datatype is represented as <s:element minOccurs="0" maxOccurs="1" name="colTxnDocs" type="tns:ArrayOfBase64Binary" />tns:ArrayOfBase64Binary so when proxy is created it is created as Array of Bytes instead of Collection(of Byte)
The WSDL will always show an ArrayOfWhatever, as generic types are not a concept that can be represented with XSD and WSDL. When you generate code from a WSDL, you can choose whether to generate arrays, List<T>, etc.
jrista
Looks like its by design in the case of webservice.