Smur
Smur

Reputation: 3113

WCF Parameter loses values

I am populating a list of MyType with 20 elements, and passing it as a parameter to a WCF Service.

The only problem is that when it gets there, the list has no elements.

My service method is:

MyMethod(List<MyType> myList, string bla)

I'm calling it like this, from a Windows Forms App:

myService.MyMethod(myList.ToArray(), "bla"); // Here my list has 20 elements.

But when it gets to the WCF Service, the array is empty. :(

Could someone help me figure out why?

PS: My WCF Service is a Windows Azure Web Role, but I don't think it changes anything in this cenario. Or does it...?

Upvotes: 3

Views: 351

Answers (2)

Smur
Smur

Reputation: 3113

It was in fact, a problem with namespaces and references...

Thank you guys.

Upvotes: 1

user203570
user203570

Reputation:

Try a quick test application that self-hosts your service to verify that you're sending and receiving properly. If that works, then you can investigate Windows Azure as the cause of your problems.

Upvotes: 1

Related Questions