Serialization of generics

Source: Internet
Author: User
Today, we are working on a remoting callcontext to transfer data. We want to implement a contextcontainer class for the data container class of the ilogicalthreadaffinative interface. At that time, I wanted to design this class as generic and load different types of data. The problem occurs:
ProgramThrow an exception: Soap Cannot serialize the contextcontainer class, so I was dizzy. So I did some tests and the results are as follows:

Binary serialization: Yes
Soap serialization: Failed
XML serialization: it seems no (the exception message is strange. contextcontainer '1 [[system. string, mscorlib, version = 2.0.0.0, culture = neutral, publickeytoken = b77a5c561934e089] is not accessible due to its protection level. Only public types can be processed .)

Soap serialization failed. I thought about it. It's also normal. WebService is for heterogeneous platforms. Who can expect JavaScript to be generic? However, XML serialization fails.

I hope the experts will make a brick to guide the reasons.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.