Customize web service proxy generated objects
Let’s say we create a web service method that returns a custom class that you are using throughout the webservice and you also consume the class of the same type in your application/web application.
What you will find is that when a web service proxy is generated the class is substituted with a newly created class that mimics the public properties of your class but it is really not the same class. This means you can not typecast between them.
Solution 1 would be to hijack the Reference.cs, make sure you are using the namespace where you class resides and finally remove the class specification from the file. The disadvantage is that each time a web reference is refreshed, these changes are lost.
Solution 2 would make sure that your changes are kept, because you can specifiy that certain classes should not be replaced by a new proxy version.
http://www.microsoft.com/belux/msdn/nl/community/columns/jdruyts/wsproxy.mspx
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.