cost
cost

Reputation: 4480

My web service takes a list of Guids as an argument, but the generated reference wants an observable collection

I'm kind of confused here. I have a WCF web service

<OperationContract()>
Function StartStep(ByVal Key As Guid, WorkOrders As List(Of Guid), UserUID As Guid, Comment As String) As Boolean

But when I generate my web reference on my client, WorkOrders comes out as an observableCollection. I created a few new web services and all of the lists are doing that. A list is a fairly common data type, I assumed it would be handled properly by WCF.. could this be because I have another function that returns an ObservableCollection and that's screwing something up? Would I have to use a KnownType or something?

Upvotes: 0

Views: 77

Answers (1)

John Saunders
John Saunders

Reputation: 161783

In the "Advanced" tab of the "Add Service Reference" dialog, you get to say how you want collections handled on the client. I guess you have it set to default to ObservableCollection, but you can select List.


Neither "List", nor "ObservableCollection", nor any other .NET type are transferred over the wire. In all cases, XML or some other such data representation is sent. The setting I mentioned earlier is about deciding how the client will interpret this XML data.

Upvotes: 1

Related Questions