Re: Web service, generics and complex data types
- From: "John Saunders [MVP]" <john.saunders at trizetto.com>
- Date: Thu, 30 Aug 2007 11:57:12 -0400
"Mike" <mike@xxxxxxxxxxx> wrote in message news:E4289F30030848D3A987EF5AF8A0372D@xxxxxxxxx
John, I really appreciate the time you've taken to answer to may
question.
This is the work around that I found.
I have all my vanilla classes in a project called Entities.
The web service reference this project (or DLL) and of course he know
what an object Customer is.
What I have in the web services are methods what will return a
serialized binary byte array.
In the client side, I will deserialize and cast back to the proper
object type (the client needs to reference Entities DLL though.
If I have to expose the web methods to third parties, I will use SOAP
serialization instead, to return raw XML.
I'm sorry, but you've made precisely the mistake I was talking about, and it's a very serious mistake.
Your client and server _cannot_ use the same DLL with web services. The fact that you have discovered a hack that seems to work does not change this fact. For instance, what about versioning? You'll have to change your client in lockstep with your server.
In fact, you have tightly bound the client and server together. They'd just as well be one thing, except that they are on different machines with a network between them.
You should be using .NET Remoting instead of web services. In fact, you seem to be re-inventing .NET Remoting as you go along. It will do all of this for you, and it will do a better job of it than you are likely to do, as they have considered scenarios encountered by many users, not just those that you have thought of already.
I benchmarked it and response times sound pretty fair to me.
What do you think about the solution?
Performance is only an issue in a single release. Your solution is unsupportable over the lifetime of your application. Among other supportability problems, you're the only person I've ever heard of who has implemented something like this. Any new developers you bring in will be unfamiliar with such a unique implementation. Around here, many would decline to work for a company that used such an implementation.
Please research .NET Remoting, or else learn how to implement Web Services using a thick wall between the client and server. This wall should only have small holes in it through which only XML may pass - not objects.
--
John Saunders [MVP]
.
- References:
- Web service, generics and complex data types
- From: Mike
- Re: Web service, generics and complex data types
- From: John Saunders [MVP]
- Re: Web service, generics and complex data types
- From: Mike
- Web service, generics and complex data types
- Prev by Date: Re: Web service, generics and complex data types
- Next by Date: Re: Underlying Connection Was Closed Error
- Previous by thread: Re: Web service, generics and complex data types
- Next by thread: What is a Proxy Class--Newbie Question
- Index(es):
Relevant Pages
|