Friday, December 18, 2009

Why don't Web Services/SOAP support passing of my own C# type?

This was asked today at work.........Look at the question again....rings the bell? ..then look again...How can SOAP be so cruel? It was never meant to pass your custom memory structures as-is, because those structures are specific to your code/library/environment/platform...How do you expect Linux binary file, originally created in C++ where all memory structures are allocated differently or even on a different processor, de-serialize your.NET class? .NET class has both data fields and methods (somewhere in a code segment) scoped to your class - you MUST have your assembly on the other end. Don't ask me how Microsoft builds a Web Service proxy on the consumer end - that's the point - it's a "proxy" it is merely an "adapter" between you and remote server, effectively you are making an RPC call and just for your convenience does Microsoft call proxy class the same name as your web service on the other end. Web services are all about cross-platform-ability, not about your .NET stuff!