IT Community - Software Programming, Web Development and Technical Support

When would we use .NET Remoting and when Web services?

This is a discussion on When would we use .NET Remoting and when Web services? within the ASP and ASP.NET Programming forums, part of the Web Development category; Hi all, When would we use .NET Remoting and when Web services?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 04-02-2008, 04:28 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Exclamation When would we use .NET Remoting and when Web services?

Hi all,

When would we use .NET Remoting and when Web services?
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-02-2008, 05:00 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Smile Re: When would we use .NET Remoting and when Web services?

Hi,

Use remoting for more efficient exchange of information when you control both ends of the application. Use Web services for open-protocol-based information exchange when you are just a client or a server with the other end belonging to someone else.
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-03-2008, 04:14 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Question Re: When would we use .NET Remoting and when Web services?

oh..great vinoth, thnx for your reply...

Do u know What are remotable objects in .NET Remoting?
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-04-2008, 02:10 AM
GDevakii GDevakii is offline
D-Web Sr.Programmer
 
Join Date: Aug 2007
Posts: 138
GDevakii is on a distinguished road
Smile Re: When would we use .NET Remoting and when Web services?

How does .NET Remoting work?
.NET remoting involves sending messages along channels. Two of the standard channels are HTTP and TCP. TCP is intended for LANs only - HTTP can be used for LANs or WANs (internet).

Support is provided for multiple message serializarion formats. Examples are SOAP (XML-based) and binary. By default, the HTTP channel uses SOAP (via the .NET runtime Serialization SOAP Formatter), and the TCP channel uses binary (via the .NET runtime Serialization Binary Formatter). But either channel can use either serialization format.

There are a number of styles of remote access:

SingleCall:

Each incoming request from a client is serviced by a new object. The object is thrown away when the request has finished. This (essentially stateless) model can be made stateful in the ASP.NET environment by using the ASP.NET state service to store application or session state.

Singleton:

All incoming requests from clients are processed by a single server object.

Client-activated object:

This is the old stateful (D)COM model whereby the client receives a reference to the remote object and holds that reference (thus keeping the remote object alive) until it is finished with it.



Using Web Application as Client we can embed config file with webconfig file
Using Web Application as Client

For creating web application as client, Take .NET IDE-> New Project named "RemotingWebClient" Type ASP.NET Web application. Take web.config and replace this file.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<system.web>

<compilation
defaultLanguage="c#"
debug="true"
/>

<customErrors
mode="RemoteOnly"
/>

<trace
enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user id=sa;password="
cookieless="false"
timeout="20"
/>

<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>

</system.web>
<system.runtime.remoting>
<application>
<client>
<wellknown
type="MohamedAshraf.Samples.MyRemoteObject,Mohamed Ashraf.Samples"
url="tcp://localhost:8000/MyRemoteObject"/>
</client>
<channels>
<channel ref="tcp" port="0">
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
RemotingWebClient.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Runtime.Remoting;
using MohamedAshraf.Samples;

namespace RemotingWebClient
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class RemotingWebClient : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
RemotingConfiguration.Configure(Server.MapPath("." ) + "\Web.config");
MyRemoteObject robj =new MyRemoteObject();
Response.Write(robj.Hello());
}

}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}


ow to run it?
Console application as server and client: Run the SimpleServer.exe then run SimpleClient.exe.
Console application as server and web as client : Run the SimpleServer.exe the run RemotingWebClient.aspx.
Window service as web service and web as client :Start window service thenrun SimpleClient.exe or RemotingWebClient.aspx
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-04-2008, 04:30 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Red face Re: When would we use .NET Remoting and when Web services?

Hmm...great article about .Net Remotting....

Krishna...

Remotable objects are the objects that can be marshaled across the application domains. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-09-2008, 08:41 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Wink Re: When would we use .NET Remoting and when Web services?

krishna...

Here is a small explonation about the proxy of the server object in .NET Remoting:

It’s a fake copy of the server object that resides on the client side and behaves as if it was the server. It handles the communication between real server object and the client object.

This process is also known as marshaling.
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-09-2008, 08:43 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Wink Re: When would we use .NET Remoting and when Web services?

Hi Krishna....

then a small walk through ....channels in .NET Remoting:

Channels represent the objects that transfer the other serialized objects from one application domain to another and from one computer to another, as well as one process to another on the same box. A channel must exist before an object can be transferred.
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-10-2008, 11:46 PM
mobilegeek mobilegeek is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 205
mobilegeek is on a distinguished road
Exclamation Re: When would we use .NET Remoting and when Web services?

What security measures exist for .NET Remoting in System.Runtime.Remoting?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-12-2008, 01:13 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Wink Re: When would we use .NET Remoting and when Web services?

None.

Security should be taken care of at the application level. Cryptography and other security techniques can be applied at application or server level.
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET Remoting S.Vinothkumar C# Programming 14 10-04-2007 07:41 AM
security measures for .NET Remoting Arun ASP and ASP.NET Programming 1 08-18-2007 12:15 AM
What are the consideration in deciding to use .NET Remoting or ASP.NET Web Services Arun ASP and ASP.NET Programming 1 08-09-2007 07:56 AM
What is .NET Remoting ? oxygen ASP and ASP.NET Programming 4 08-08-2007 02:37 AM
Flash Remoting nssukumar Flash Actionscript Programming 3 03-20-2007 05:28 AM


All times are GMT -7. The time now is 08:31 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0