WCF Architecture question

S

SetonSoftware

We're planning to construct a C# 3.5 application as an XBAP. This
application will run in browsers on several thouasnd notebook
computers which are connected to a central server via wireless. The
application will use a SQL Server 2008 database.

The app would need to access data object assembies on the server to
read DataTables from and write data to the database though stored
procedures. The server is also where the business rule assemblies
would reside. I'm thinking one server to host the assemblies and
another to host SQL Server. The XBAP application will communicate with
the business layer server directly.

My question is: What kind of WCF architecture is most appropriate
here? Should I use an HTTP protocol hosted by IIS or TCP hosted by a
Windows service?

Thanks

Carl
 
S

sloan

In a DotNet to DotNet world (where you don't care about supporting non
dotnet clients like java/asp etc)......
Here is a basic example:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!158.entry


You should purchase Juval Lowy's book on Programming WCF Services.


There are pros and cons for each. You have to decide which pro/con you
desire more.

Research WAS IIS7 (<< google it)

I use named pipes because my webserver and WCF host are on the same machine.

Juval's book will take you through very detailed reasons why to pick one
over the other.
 
P

Peter Morris

I'm currently part of a team developing a project that uses Silverlight for
the UI and Hessian to talk to a remote facade hosted within IIS.
 
S

SetonSoftware

Using IIS has the following benefits:

1) IIS provides automatic processing activation, meaning when a message is
received for a service, the service is automatically launched if it is not
already launched.

2) IIS provides health monitors that a WCF services can take advantage of..
If a process in not responding or is taking longer than deemed necessary,
IIS will automatically recycle the process.

3) WCF service  can utilize the ASP.NET shared hosting model.

4) WCF service  can take advantage of the ASP.NET's compilation model.

IIS  5, 6 and 7 you get the following:

. Idle shutdown
. Process recycling
. Process health monitoring
. Message-based activation

You're using FW 3.5 and I'll assume VS 2008. If you are doing so, then you
should look into Linq to SQL using ADO.Net.Entities, fabulous stuff and
Datatables -- yuck.

http://www.codeguru.com/csharp/csha...1/http://www.apress.com/book/view/1590599659- Hide quoted text -

- Show quoted text -

This application is completely .NET to .NET communication. If I use
IIS am I limited to HTTP? Wouldn't TCP be faster? If I do use HTTP,
data sent between the different tiers would need to be serialized
whereas with TCP it wouldn't need to be, correct? This is all being
done on a WinXP platform.

Thanks

Carl
 
S

sloan

If you're doing DotNet to DotNet, then I would give up the convenience of
WAS and write a Host as a Windows Service using TCP.

Check my example on "Interface development with WCF"




Using IIS has the following benefits:

1) IIS provides automatic processing activation, meaning when a message is
received for a service, the service is automatically launched if it is not
already launched.

2) IIS provides health monitors that a WCF services can take advantage of.
If a process in not responding or is taking longer than deemed necessary,
IIS will automatically recycle the process.

3) WCF service can utilize the ASP.NET shared hosting model.

4) WCF service can take advantage of the ASP.NET's compilation model.

IIS 5, 6 and 7 you get the following:

. Idle shutdown
. Process recycling
. Process health monitoring
. Message-based activation

You're using FW 3.5 and I'll assume VS 2008. If you are doing so, then you
should look into Linq to SQL using ADO.Net.Entities, fabulous stuff and
Datatables -- yuck.

http://www.codeguru.com/csharp/csha...1/http://www.apress.com/book/view/1590599659-
Hide quoted text -

- Show quoted text -

This application is completely .NET to .NET communication. If I use
IIS am I limited to HTTP? Wouldn't TCP be faster? If I do use HTTP,
data sent between the different tiers would need to be serialized
whereas with TCP it wouldn't need to be, correct? This is all being
done on a WinXP platform.

Thanks

Carl
 
M

Mr. Arnold

Using IIS has the following benefits:

1) IIS provides automatic processing activation, meaning when a message is
received for a service, the service is automatically launched if it is not
already launched.

2) IIS provides health monitors that a WCF services can take advantage of.
If a process in not responding or is taking longer than deemed necessary,
IIS will automatically recycle the process.

3) WCF service can utilize the ASP.NET shared hosting model.

4) WCF service can take advantage of the ASP.NET's compilation model.

IIS 5, 6 and 7 you get the following:

. Idle shutdown
. Process recycling
. Process health monitoring
. Message-based activation

You're using FW 3.5 and I'll assume VS 2008. If you are doing so, then you
should look into Linq to SQL using ADO.Net.Entities, fabulous stuff and
Datatables -- yuck.

http://www.codeguru.com/csharp/csha...1/http://www.apress.com/book/view/1590599659-
Hide quoted text -

- Show quoted text -

This application is completely .NET to .NET communication. If I use
IIS am I limited to HTTP?

As far as I know, if you're using a Web service WCF of not, it's using HTTP.

Wouldn't TCP be faster?

HTTP in a Web service is using TCP port 80.


If I do use HTTP,
data sent between the different tiers would need to be serialized
whereas with TCP it wouldn't need to be, correct?

I don't know if you're talking logical tiers or physical tier separation.
For faster communications between physical tiers, I have not seen a solution
that was not using serialization with objects, using .Net Remoting over TCP
or Web server/Web service where N-tier was part of the equation.

If it were me using a WCF TCP solution, the objects would be serialized
for faster transmission.

All solutions that I have worked on that sent data between tiers in a N-tier
solution
This is all being
done on a WinXP platform.

I don't know what kind of payload you're going to have on the service, but
you should keep in mind about the concurrency connection limitations for a
solution that is hosted on a non server O/S system platform such as XP, as
the limitation of concurrent network connections for a XP workstation is 10,
and a WCF TCP solution hosted by XP could be a problem.

Also keep in mind that a Web service using IIS is a stateless solution,
meaning the connection is terminated with the client allowing other clients
to be serviced, which is all controlled by the Web server.

So, you shouldn't go down the road haphazardly, you should get all the
cards on the table, and take a look at how you are going design an
enterprise n-tier solution using WCF.

If you're using VS 2008, then there is a tool that can be install to help
you develop your WCF solutions and examples of best practices.

http://msdn.microsoft.com/en-us/library/cc487895.aspx

Do your homework and if that takes for you to get a book or two, then you
should do it, not paint yourself into a corner, and get yourself hurt.
 
A

Anthony Jones

Using IIS has the following benefits:

1) IIS provides automatic processing activation, meaning when a message is
received for a service, the service is automatically launched if it is not
already launched.

2) IIS provides health monitors that a WCF services can take advantage of.
If a process in not responding or is taking longer than deemed necessary,
IIS will automatically recycle the process.

3) WCF service can utilize the ASP.NET shared hosting model.

4) WCF service can take advantage of the ASP.NET's compilation model.

IIS 5, 6 and 7 you get the following:

. Idle shutdown
. Process recycling
. Process health monitoring
. Message-based activation

You're using FW 3.5 and I'll assume VS 2008. If you are doing so, then you
should look into Linq to SQL using ADO.Net.Entities, fabulous stuff and
<<<<<<<<<<<<<<<<<<<<<<
This application is completely .NET to .NET communication. If I use
IIS am I limited to HTTP? Wouldn't TCP be faster? If I do use HTTP,
data sent between the different tiers would need to be serialized
whereas with TCP it wouldn't need to be, correct? This is all being
done on a WinXP platform.
If you use IIS then yes the HTTP protocol is needed.

HTTP is layered on top of TCP, I doubt in any real terms using TCP in the
raw would be any faster.

Even over raw TCP object state would need to be serialised.
 
P

Peter Morris

2) IIS provides health monitors that a WCF services can take advantage of.
If a process in not responding or is taking longer than deemed necessary,
IIS will automatically recycle the process.

I am writing a web service which will maintain some session state in memory.
Under what circumstances does this restart occur? I am concerned that I
will lose this state.
 
A

Anthony Jones

Peter Morris said:
I am writing a web service which will maintain some session state in
memory. Under what circumstances does this restart occur? I am concerned
that I will lose this state.

An application pool can be configured to recycle after a specified interval,
after handling a set number of requests, at specific time of day.

There can be limits set on the VM size or private memory size that if exceed
result in a recycle.

Changes to the web.config or an unhealthy ISAPI filter is detected.

The app pool fails to respond to configured health check ping in an
appropriate amount of time.

Of course an administrator may simply call recycle on the app pool.
 
M

Mr. Arnold

Alvin Bruney said:
The point of WCF is that you don't need to answer these questions. An
administrator will configure whether or not named pipes or http is used.
You focus on writing the business logic that's all.

Well, I beg to differ, as he is most likely going to be the *guy* who blazes
the trail in the company, sets the whole thing up, develops it and
implements it too. ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top