문제

i am using third party classes in my service, so i cant edit them.

third party

[Serializable]  
Class B : E  

[Serialazable]  
Class E : A  

service

[ServiceKnownType(typeof(B))]  
[ServiceKnownType(typeof(E))]  
fun(A pic)  

client

for some reason :

proxy.fun(object)  

throw an exception that B is unexpected and add it to the datacontractSerializer KnownTypes

what reason can it be ?.

도움이 되었습니까?

해결책

Are you applying the ServiceKnownType attribute on the service contract or the service implementation? The ServiceKnownType attribute is meant to be to be used on your contract interface.

http://msdn.microsoft.com/en-us/library/system.servicemodel.serviceknowntypeattribute.aspx

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top