By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,728 Members | 2,490 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,728 IT Pros & Developers. It's quick & easy.

Need Asynchronous WCF solution which allows for multiple responses

P: n/a
Bear with me because we are new to WCF and have been going through
documentation and samples trying to absorb as much as possible in a
short amount of time. Any suggestions would be much appreciated. We
would of course rather start off on the right path instead of learning
later that there's a much better and easier solution, but get stuck
with our original implementation.

We are working on designing a client server solution using WCF where
we will have at most 20 clients calling the server with a requests
using NetTcp. Because of the amount of data that can be returned and
usability we want to make this an asynchronous call as well as allow
the server return chunks of data at a time.

- It looks like the Duplex calls only allow for a single response from
the server, so this option is out.
- We have considered creating an Endpoint on both the server and the
client. When requesting data from the server the client would pass
it's Endpoint information to the server. The server would then create
a channel using the client Endpoint info and send responses to the
client in chunks.
- We have also considered using a pattern similar to reading data from
a file where the client will request chunks of data from the server in
multiple calls until it receives an EOF flag. This would need to be
asynchronous as well. This would keep us from creating an Endpoint on
each client. I'm not sure if this is a benefit, but it's one less
thing to do.
- Finally, what would be the best way to pass back the data. We've
created a simple data container, which looks like a basic dataset and
is decorated to allow serialization by WCF. It seems like it would be
sufficient.

Again, any suggestions to get us on the right path earlier rather than
later would be very much appreciated.

Jayson

Mar 8 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
<jt*********@yahoo.comwrote in message
news:11*********************@t69g2000cwt.googlegro ups.com...
Bear with me because we are new to WCF and have been going through
documentation and samples trying to absorb as much as possible in a
short amount of time. Any suggestions would be much appreciated. We
would of course rather start off on the right path instead of learning
later that there's a much better and easier solution, but get stuck
with our original implementation.

We are working on designing a client server solution using WCF where
we will have at most 20 clients calling the server with a requests
using NetTcp. Because of the amount of data that can be returned and
usability we want to make this an asynchronous call as well as allow
the server return chunks of data at a time.

- It looks like the Duplex calls only allow for a single response from
the server, so this option is out.
- We have considered creating an Endpoint on both the server and the
client. When requesting data from the server the client would pass
it's Endpoint information to the server. The server would then create
a channel using the client Endpoint info and send responses to the
client in chunks.
- We have also considered using a pattern similar to reading data from
a file where the client will request chunks of data from the server in
multiple calls until it receives an EOF flag. This would need to be
asynchronous as well. This would keep us from creating an Endpoint on
each client. I'm not sure if this is a benefit, but it's one less
thing to do.
- Finally, what would be the best way to pass back the data. We've
created a simple data container, which looks like a basic dataset and
is decorated to allow serialization by WCF. It seems like it would be
sufficient.

Again, any suggestions to get us on the right path earlier rather than
later would be very much appreciated.

Jayson

Please post WCF related questions to the WCF forum at :
http://forums.microsoft.com/MSDN/Sho...D=118&SiteID=1

Willy.
Mar 8 '07 #2

P: n/a


<jt*********@yahoo.comwrote in message
news:11*********************@t69g2000cwt.googlegro ups.com...
Bear with me because we are new to WCF and have been going through
documentation and samples trying to absorb as much as possible in a
short amount of time. Any suggestions would be much appreciated. We
would of course rather start off on the right path instead of learning
later that there's a much better and easier solution, but get stuck
with our original implementation.

We are working on designing a client server solution using WCF where
we will have at most 20 clients calling the server with a requests
using NetTcp. Because of the amount of data that can be returned and
usability we want to make this an asynchronous call as well as allow
the server return chunks of data at a time.
How much data are you talking about? Have you tested using a simple duplex
contract using a binary formatter and tcp transport?

David

Mar 8 '07 #3

P: n/a
On Mar 8, 10:46 am, "Willy Denoyette [MVP]"
<willy.denoye...@telenet.bewrote:
<jtbjurst...@yahoo.comwrote in message

news:11*********************@t69g2000cwt.googlegro ups.com...
Please post WCF related questions to the WCF forum at :http://forums.microsoft.com/MSDN/Sho...D=118&SiteID=1

Willy.
Will do. Thanks.

Mar 8 '07 #4

P: n/a
On Mar 8, 11:06 am, "David Browne" <davidbaxterbrowne no potted
m...@hotmail.comwrote:
<jtbjurst...@yahoo.comwrote in message

news:11*********************@t69g2000cwt.googlegro ups.com...
How much data are you talking about? Have you tested using a simple duplex
contract using a binary formatter and tcp transport?

David
We are estimating that the larger responses could be around 75 mb. The
size is definitely an issue but the server accumulates the data in
chunks and it also can take while to gather all the data. So, getting
the data back in subsets is ideal.

Mar 8 '07 #5

P: n/a
Thus wrote jt*********@yahoo.com,
Bear with me because we are new to WCF and have been going through
documentation and samples trying to absorb as much as possible in a
short amount of time. Any suggestions would be much appreciated. We
would of course rather start off on the right path instead of learning
later that there's a much better and easier solution, but get stuck
with our original implementation.

We are working on designing a client server solution using WCF where
we will have at most 20 clients calling the server with a requests
using NetTcp. Because of the amount of data that can be returned and
usability we want to make this an asynchronous call as well as allow
the server return chunks of data at a time.
Asynchronous calls and asynchronous service execution are local phenomenon
and are not related to what happens on the wire or what metadata a service
exposes.

As far as chunking is concerned -- there are several implementations available
on the Web, but probably you want to use streaming instead, which is built-in.
- It looks like the Duplex calls only allow for a single response from
the server, so this option is out.
I'm not sure what you mean by "single message". A service can implement only
one Duplex contract, but you can host multiple Duplex bound services in a
single server application.
- We have considered creating an Endpoint on both the server and the
client. When requesting data from the server the client would pass
it's Endpoint information to the server. The server would then create
a channel using the client Endpoint info and send responses to the
client in chunks.
This gives you more flexibility regarding contract design, but you must implement
a full blown service host in your client application.
- We have also considered using a pattern similar to reading data from
a file where the client will request chunks of data from the server in
multiple calls until it receives an EOF flag.
That's ugly, as it exposes technical communication details in your service
contracts. That's what WCF actually tries to avoid.

[...]
- Finally, what would be the best way to pass back the data. We've
created a simple data container, which looks like a basic dataset and
is decorated to allow serialization by WCF. It seems like it would be
sufficient.
How did you allow serialization? In case of doubt, use a DataContract.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Mar 8 '07 #6

P: n/a
On Mar 8, 1:08 pm, Joerg Jooss <news-re...@joergjooss.dewrote:
Thus wrote jtbjurst...@yahoo.com,
Bear with me because we are new to WCF and have been going through
documentation and samples trying to absorb as much as possible in a
short amount of time. Any suggestions would be much appreciated. We
would of course rather start off on the right path instead of learning
later that there's a much better and easier solution, but get stuck
with our original implementation.
We are working on designing a client server solution using WCF where
we will have at most 20 clients calling the server with a requests
using NetTcp. Because of the amount of data that can be returned and
usability we want to make this an asynchronous call as well as allow
the server return chunks of data at a time.

Asynchronous calls and asynchronous service execution are local phenomenon
and are not related to what happens on the wire or what metadata a service
exposes.

As far as chunking is concerned -- there are several implementations available
on the Web, but probably you want to use streaming instead, which is built-in.
- It looks like the Duplex calls only allow for a single response from
the server, so this option is out.

I'm not sure what you mean by "single message". A service can implement only
one Duplex contract, but you can host multiple Duplex bound services in a
single server application.
- We have considered creating an Endpoint on both the server and the
client. When requesting data from the server the client would pass
it's Endpoint information to the server. The server would then create
a channel using the client Endpoint info and send responses to the
client in chunks.

This gives you more flexibility regarding contract design, but you must implement
a full blown service host in your client application.
- We have also considered using a pattern similar to reading data from
a file where the client will request chunks of data from the server in
multiple calls until it receives an EOF flag.

That's ugly, as it exposes technical communication details in your service
contracts. That's what WCF actually tries to avoid.

[...]
- Finally, what would be the best way to pass back the data. We've
created a simple data container, which looks like a basic dataset and
is decorated to allow serialization by WCF. It seems like it would be
sufficient.

How did you allow serialization? In case of doubt, use a DataContract.

Cheers,
--
Joerg Jooss
news-re...@joergjooss.de
Thanks. I'll have to look into streaming our return data. Are there
any examples or articles out there for this?

Mar 12 '07 #7

P: n/a
Thus wrote jt*********@yahoo.com,

[...]
Thanks. I'll have to look into streaming our return data. Are there
any examples or articles out there for this?
MSDN and the Windows SDK contain sample code. You can find more information
at http://msdn2.microsoft.com/en-us/library/ms731913.aspx. You may also want
to check out both Nicholas Allen's blog and Kenny Wolf's blog.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Mar 13 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.