I am trying to add a new service method to my existing WCF web service project which uses BasicHttpBinding.
My new service method accepts a class as a parameter and this class has a List<T> variable. After adding this method, my web service client can not add the service reference. It receives (415) Unsupported Media Type. error message.
Does that mean WCF BasicHttpBinding does not support List type? Should I use array type instead? If it supports List, then where should I look for the error?
I am trying to add a new service method to my existing WCF web
Share
Listis supported.Check the configuration on misspelling!
For example, NetworkingService instead of NetwokingService link.
When you adding the service reference check configuration window. There is a choice how to consider
List, Dictionary, Arraywhen data is send.Choose as
List.Do not try work with anonymous generic
List<T>. WCF cannot create WSDL information for anonymous types. It may beList<MyClass>.Also it is not recommended for using because of data ceiling. The maximum bytes value is configurable but is limited.
The better solution is to implement new class
And then send or receive objects by parts (by 10, 100 ,…).