[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Pepe Le Peu

6/9/2004 2:40:00 PM


I have been looking at Remoting and Web Services and I think I can do almost
anything I want with Web Services.

Here's my intellectual puzzle though:

Suppose I wanted to create a P2P application using just web services.

It would work something like this:

1) Assume a client (A) with a button and a text box.

2) Assume the client is aware of an identical client (B) on another machine.

3) The client has a web method, Update(string Str)

4) When the method is called it sets the label.Text = Str


So the idea is this is a very basic chat application.

Client A cals ClientB.Update()

and

Client B calls ClientA.Update()

The thing I need to figure out is how a c# windows form client can expose a
web method such as Update() ?

Is it possible ?

Is there an easy way to put a web services method into a regular client
app ?


--
w:04

5 Answers

Nicholas Paldino [.NET/C# MVP]

6/9/2004 2:43:00 PM

0

Pepe,

Web services are not a good idea in this situation. The first thing is
that you would have to have some sort of loosely coupled eventing in your
web service which your UI would hook up to in order to send and receive
messages. This would be difficult to implement, to say the least.
Secondly, you have to host ASP.NET in your application to take advantage of
this, and this is no small feat.

I think that remoting would be a better solution for this, personally.
Either that, or use sockets directly for sending and receiving your
messages. Your overhead (on the line) would be much less.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

"Pepe Le Peu" <aaaaaaa@mon.cheri> wrote in message
news:2812666.RZCbFHnERG@news.west.earthlink.net...
>
> I have been looking at Remoting and Web Services and I think I can do
almost
> anything I want with Web Services.
>
> Here's my intellectual puzzle though:
>
> Suppose I wanted to create a P2P application using just web services.
>
> It would work something like this:
>
> 1) Assume a client (A) with a button and a text box.
>
> 2) Assume the client is aware of an identical client (B) on another
machine.
>
> 3) The client has a web method, Update(string Str)
>
> 4) When the method is called it sets the label.Text = Str
>
>
> So the idea is this is a very basic chat application.
>
> Client A cals ClientB.Update()
>
> and
>
> Client B calls ClientA.Update()
>
> The thing I need to figure out is how a c# windows form client can expose
a
> web method such as Update() ?
>
> Is it possible ?
>
> Is there an easy way to put a web services method into a regular client
> app ?
>
>
> --
> w:04
>


2G

6/9/2004 3:32:00 PM

0

I geuss you'll have to go with remoting.
A webservice needs to run on iis as far as I know so...

"Pepe Le Peu" <aaaaaaa@mon.cheri> wrote in message
news:2812666.RZCbFHnERG@news.west.earthlink.net...
>
> I have been looking at Remoting and Web Services and I think I can do
almost
> anything I want with Web Services.
>
> Here's my intellectual puzzle though:
>
> Suppose I wanted to create a P2P application using just web services.
>
> It would work something like this:
>
> 1) Assume a client (A) with a button and a text box.
>
> 2) Assume the client is aware of an identical client (B) on another
machine.
>
> 3) The client has a web method, Update(string Str)
>
> 4) When the method is called it sets the label.Text = Str
>
>
> So the idea is this is a very basic chat application.
>
> Client A cals ClientB.Update()
>
> and
>
> Client B calls ClientA.Update()
>
> The thing I need to figure out is how a c# windows form client can expose
a
> web method such as Update() ?
>
> Is it possible ?
>
> Is there an easy way to put a web services method into a regular client
> app ?
>
>
> --
> w:04
>


Sunny

6/9/2004 3:33:00 PM

0

Hi,
no, web services run only under IIS. So, you have to go with remoting.
And you can use HTTP channels and SOAP formatter if you need it.

Sunny

In article <2812666.RZCbFHnERG@news.west.earthlink.net>,
aaaaaaa@mon.cheri says...
>
> I have been looking at Remoting and Web Services and I think I can do almost
> anything I want with Web Services.
>
> Here's my intellectual puzzle though:
>
> Suppose I wanted to create a P2P application using just web services.
>
> It would work something like this:
>
> 1) Assume a client (A) with a button and a text box.
>
> 2) Assume the client is aware of an identical client (B) on another machine.
>
> 3) The client has a web method, Update(string Str)
>
> 4) When the method is called it sets the label.Text = Str
>
>
> So the idea is this is a very basic chat application.
>
> Client A cals ClientB.Update()
>
> and
>
> Client B calls ClientA.Update()
>
> The thing I need to figure out is how a c# windows form client can expose a
> web method such as Update() ?
>
> Is it possible ?
>
> Is there an easy way to put a web services method into a regular client
> app ?
>
>
>

Sami Vaaraniemi

6/9/2004 5:13:00 PM

0


"Pepe Le Peu" <aaaaaaa@mon.cheri> wrote in message
news:2812666.RZCbFHnERG@news.west.earthlink.net...
>
> I have been looking at Remoting and Web Services and I think I can do
almost
> anything I want with Web Services.
>
> Here's my intellectual puzzle though:
>
> Suppose I wanted to create a P2P application using just web services.
>
> It would work something like this:
>
> 1) Assume a client (A) with a button and a text box.
>
> 2) Assume the client is aware of an identical client (B) on another
machine.
>
> 3) The client has a web method, Update(string Str)
>
> 4) When the method is called it sets the label.Text = Str
>
>
> So the idea is this is a very basic chat application.
>
> Client A cals ClientB.Update()
>
> and
>
> Client B calls ClientA.Update()
>
> The thing I need to figure out is how a c# windows form client can expose
a
> web method such as Update() ?
>
> Is it possible ?
>
> Is there an easy way to put a web services method into a regular client
> app ?

You could use WSE 2.0 and its messaging features. You can have a
SoapReceiver instance in the client that listens to a TCP port. No IIS
required.

Check out http://msdn.microsoft.com/msdnmag/issues/03/09... .
(Unfortunately the samples were written for the WSE 2.0 Technology Preview.
There are some differences so the code will not compile as-is with WSE 2.0.
The concepts are still applicable though.)

Regards,
Sami


Elp

6/9/2004 6:23:00 PM

0


"Pepe Le Peu" <aaaaaaa@mon.cheri> wrote in message
news:2812666.RZCbFHnERG@news.west.earthlink.net...
> The thing I need to figure out is how a c# windows form client can expose
a
> web method such as Update() ?
>
> Is it possible ?
>
> Is there an easy way to put a web services method into a regular client
> app ?

It looks that you missed completely the whole thing about Web Services: a
Web Service is just like a web site except that it doesn't return HTML code
but the result of the execution of a method in an XML form. This means that
a web service *has* to be hosted in a Web server. Nothing prevents you from
buidling a web server within your application though but i think that it
would be really overkill for the task...

And here comes .NET Remoting: with .NET Remoting, you can do all that you
can do with Web Service and more with the ability to host both the client
and server parts in any application. The downside is that you loose most of
the time the "standards respect" thing which means that only .NET
applications will be able to communicate with each other through .NET
Remoting (this is not entirely true though but .NET Remoting has not been
designed to be interroperable).