Re: WCF Proxies
- From: "RYoung" <rcyoungatinkspotdev.com>
- Date: Sat, 11 Nov 2006 18:52:43 -0600
It's not so much that ASMX web services aren't meeting your needs, in as
much that it's the way you went about the design of the service.
Essentially, you've got a network composed of A, B, and C - and a client
that wants to communicate with those three. The client expects a "result"
message back from them, and can send them "request" messages that they all
understand. For them and the client to all speak the same language, the
language becomes the protocol for the network.
What you can do is this: use a single service as the "authority" for the
protocol specification of your network. This service is where all operations
and typed messages are defined. The types can be defined in a
CommonTypes.dll but that assembly is only for the service - it is not
deployed to the client.
The only knowledge the client has of the "types" is those defined in the
WSDL provided by the service. So the client generates a proxy for the WSDL.
And you can change the URL property of the proxy class to point it at
different services.
In a sense, the client is saying it expects a message in the defined format,
and the services provide messages in that format.
I implemented something similiar where the IODEF specification was the
defined format, and three servers are providers of messages in that format,
with additional servers to be added later. The end result is the client
queries a database to get list of URLs for each server, then loops through
the list, calling each service: something like so:
void Main()
{
PublisherService svc = new PublisherService();
foreach (string s in urls)
{
svc.Url = s;
IODEFDocument doc = svc.GetReport();
// do something with it
}
}
The "network" also has Java clients running a similiar routine to invoke the
available servers.
There is a downfall to this, in that the IODEF spec is a pretty rich
document, and less than desirable to work with on the client side. For
instance, I wanted to display some aspects of the document in a .NET 1.1
DataGrid so I could get that multi-table view in a single grid. So I had to
map the IODEFDocument class from the proxy to a typed dataset - which is
pretty tedious code-wise.
But, the important thing is - don't distribute the CommonTypes.dll to the
client because all the info they need (to generate code) they can get from
the WSDL.
Ron
"Tatworth" <Tatworth@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DD9D3F0B-45D3-4AFD-B65E-38CF19BDD3ED@xxxxxxxxxxxxxxxx
In my example service A, B and C while having the same return type, all
perform different actions, even though they all have the same signature.
They could all be consumed bya single application. Coding would be
simplified
if I could refer to just Common.Return instead A.Return, B.Return or
C.Return
as the proxy creation process recognised that the each service method
returned Common.Return and code the proxy class as such.
"Tatworth" wrote:
Is there any advantage in upgrading from ASP.NET 2.0/WSE 3.0 to WCF RC1
is
respect of generated web proxies?
Under ASP.NET 2.0/WSE 3.0 if web services A, B, C all have a method that
returns a structure COMMON.RESULT, the generated proxies will be
A.RESULT,
B.RESULT, C.RESULT. Does WCF improve on this?
.
- Prev by Date: Re: consume wse 3.0 .net service from java wss4j
- Next by Date: Re: Web.config Error
- Previous by thread: WSE 2.0 with X509 Certs
- Next by thread: Re: I want to Dynamically Discover Web Services
- Index(es):
Relevant Pages
|
Loading