Something Don Box posted yesterday in his blog reminded me of an investigation I made this summer that I never wrote about.
My goal was to create a black box that would take a SOAP message as input and return the resulting SOAP message as output using the .NET framework. This was right after I created the program I wrote about in Executing ASPX pages without a web server.
I didn't think this would be too difficult, but it was. I made one false start after another. Every time I thought I had it figured out, I'd discover that something I needed to call was marked "internal" to one or another HTTP assembly.
The solution I finally came up with drags in a good bit of the HTTP infrastructure, but without any dependence on the presence of a network or of IIS. My code extends SimpleWorkerRequest and feeds ASP.NET the information it needs just like a web server would, information like the HTTP method ("POST"), the SOAPAction header, and the entity body.
Don's blog item (on SOAP and BEEP) makes me think that there should be a cleaner, more elegant way, but if there is, I didn't find it. He does unintentionally throw me a little sop, writing that "On the server side, it's a bit tougher to break out of HTTP unless you're willing to host ASP.NET behind a different protocol (which is supported if not terribly obvious)."
2:49:57 PM
|