We are required to use a specific library for serialization, that is used like this:
var obj = Serializer.Deserialize(myStream); //Read
Serializer.Serialize(obj, myOtherStream); //Write
We need to expose this via a web service, and I have gotten this working as such:
- File -> New Project -> ASP .Net WebForms site
- In Page.Load, we use the Request and Response members to do the serialization
- Modify the ContentType in the Response
- We then call Response.End()
- We also had to put Async=”true” in the aspx page
And all of this seems to be working fine.
Is there a better way to handle this? We want our service to run in IIS, but we didn’t know if there was any overhead in making this an aspx page.
Is there any benefit to hooking this up with WCF?
Well, if you have a page that has no actual web form components, you can just use a handler page. That will cut down on some overhead.