Category: Web Service

Reducing ASP.Net site initial delay time

By Ashish Khandelwal, November 12, 2009

Reducing the delay time upon first requests to a DotNetNuke or other ASP.NET website is something that I see asked quite often.  This delay is due to the ASP.NET Worker Process compling a website, this articles will discuss the solutions available to prevent this delay from occuring.   I personally find that the simplest solution is the best; the even better part is that it is free! First of all before I talk about the different solutions available let me first explain the issue and why it happens.

Depending on your specific setup and hosting environment this initial load time can be quite lengthy. I have noticed initial load times of anywhere from 4-5 seconds to over 25 depending on the server configuration and load. What is actually happening is that your DNN site is being compiled after the ASP.NET worker process has restarted. The worker process can restart for many reasons, however the most troubling one is due to site traffic. By default IIS will shut down the ASP.NET worker process after 20 minutes of inactivity meaning that the next request will restart the worker process and cause the compilation to occur. Read more »

VN:F [1.7.2_963]
Rating: 0.0/5 (0 votes cast)

.NET Remoting versus Web Services

By Ashish Khandelwal, October 25, 2009

Introduction

Unless you have been living in a cave, or are way behind in your reading, you have probably read something about Web services. When you read the description of .NET Remoting it may remind you a lot of what you’re read about Web services. That is because Web services fall under the umbrella of .NET Remoting, but have a simplified programming model and are intended for a wide target audience.
Web services involve allowing applications to exchange messages in a way that is platform, object model, and programming language independent. Web services are stateless and know nothing about the client that is making the request. The clients communicate by transferring messages back and forth in a specific format known as the Simple Object Access Protocol, or SOAP.

Read more »

VN:F [1.7.2_963]
Rating: 3.0/5 (2 votes cast)

Introduction to .NET Web Services

By Ashish Khandelwal, October 25, 2009

What’s a Web Service?

The buzz word around IT these days is Web Services. A web service is not a website that a human reads. It is not anything with which an end user would directly interact. A web service is a standard platform for building interoperable distributed applications. It allows you as a developer, to interact with other information providers without worrying about what they are running either at the backend or even their front-end. Take for example a company stock ticker that you may wish to have, say on your website or intranet. The data could possibly be coming from a major news site like MSN or NASDAQ. The way you would currently achieve this is either by buying access to their database or by ‘scraping’ their home page HTML for the relevant data and converting it into your format. Suppose they go ahead and change their web design, all the scraping code you would have written would be rendered useless. Even if you buy access into their system, they may be running a technology that is incompatible or too hard to work with your own. Read more »

VN:F [1.7.2_963]
Rating: 4.0/5 (1 vote cast)

Creating IIS7 sites, applications, and virtual directories

By Ashish Khandelwal, October 21, 2009

what’s the deal with sites, applications, and virtual directories?
Before you can serve a single request from your IIS7 server, you need to create a set of configuration that describes how the server listens for requests, and how these requests are then dispatched to your scripts or static files.  To do this, you need to at minimum create a site, an application, a virtual directory, and an application pool, which together provide the basic configuration necessary to serve your website (to be fair, the default configuration of the server already includes a set of these that you can use right away – more on that later).

A site is the top-level logical container that specifies how http requests are received and processed – it defines a group of bindings that determine how the site listens for incoming requests, and contains the definitions of applications/virtual directories that partition the site’s url namespace for the purposes of structuring your application content.

A binding is a combination of protocol name and protocol-specific binding information.  While IIS7  supports multi-protocol bindings (WCF’s soap-tcp, FTP, etc), we will focus on the http path only here.  So, for our purposes an http binding effectively defines an http endpoint that listens on:

  • A specific interface ip address (or all interfaces)
  • A specific port number
  • A specific http host header (or all host headers)

This way, you can configure many sites on your server that listen on different ip addresses, different ports, or on the same ip address / port but with different host headers. 

It’s important to note that the url of the request has no part in determining which site the request is routed to – only the bindings do.  All requests received on a binding are sent to the site that owns the binding, so effectively each site owns its own full url namespace starting with “/”. 
This url namespace is then partitioned further into applications, and then further yet by virtual directories.

An application is a logical container of your website’s functionality, allowing you to divide your site’s url namespace into separate parts and control the runtime behavior of each part individually.  For example, each application can be configured to be in a separate application pool, thereby isolating it from other applications by putting it in a separate process, and optionally making that process run with a different Windows identity to sandbox it.  The application is also the level at which ASP.NET applications / appdomains are created.

Each application has a virtual path that matches the initial segment of the url’s absolute path for the requests to that application.  A request is routed to the application with the longest matching virtual path. 
- Each site must have at least the root application with the virtual path of “/”, so any requests not matching other applications in the site will be routed to the root application.

Finally, a virtual directory maps a part of the application url namespace to a physical location on disk.  When a request is routed to the application, it uses the same algorithm to find the virtual directory with the longest virtual path matching the remainder of the request’s absolute path after the application path.   
- Again, each application must have at least the root virtual directory with the virtual path of “/” to be functional.
Read more »

VN:F [1.7.2_963]
Rating: 5.0/5 (1 vote cast)

Understanding the Built-In User and Group Accounts in IIS 7.0 vs IIS 6.0

By Ashish Khandelwal, October 21, 2009

Here is detail explaination about the IIS 7.0 and IIS 6.0 user and group account from IIS team.

Introduction

In previous versions of IIS, we had a local account created at install time called IUSR_MachineName. The IUSR_MachineName account was the default identity used by IIS whenever anonymous authentication was enabled. This was used by both the FTP and HTTP services. 

There was also had a group called IIS_WPG, used as a container for all the application pool identities. We made sure all the appropriate resources on the system had the correct permissions set for the IIS_WPG group during IIS setup so that an administrator only needed to add their identity to that group when they created a new application pool account.

This model worked well, but had its drawbacks: the IUSR_MachineName account and IIS_WPG group were both local to the system it was created on. Every account and group within Windows is given a unique number called a SID (security identifier) that distinguishes it from other accounts. When an ACL is created only the SID is used. As part of our design in previous versions of IIS, we had included the IUSR_MachineName in the metabase.xml file so that if you tried to copy the metabase.xml from one machine to another, it would not work–the account on the other machine would have a different name.

In addition, you could not just ‘xcopy /o’ ACLs from one machine to another since the SIDs were different machine to machine. A work around was to use domain accounts–but that required adding an active directory to the infrastructure. The IIS_WPG group had similar issues with permissions. If you set ACLs on one machine’s file system for IIS_WPG and tried to ‘xcopy /o’ those over to another machine, it would fail. The IIS team heard this feedback and improved this experience by using a built-in account and group in IIS 7.0.

 A built-in account and group are guaranteed by the operating system to always have a unique SID. IIS 7.0 has taken this further and ensured the actual names used by the new account and group will never be localized. For example, regardless of the language of Windows you install, the IIS account name will always be IUSR and the group name will be IIS_IUSRS.

 In summary, IIS 7.0 offers:

  • The IUSR built-in account replaces the IUSR_MachineName account
  • The IIS_IUSRS built-in group replaces the IIS_WPG group Read more »
VN:F [1.7.2_963]
Rating: 5.0/5 (1 vote cast)

What’s a Web Service?

By Ashish Khandelwal, July 30, 2009

What’s a Web Service?

The buzz word around IT these days is Web Services. A web service is not a website that a human reads. It is not anything with which an end user would directly interact. A web service is a standard platform for building interoperable distributed applications. It allows you as a developer, to interact with other information providers without worrying about what they are running either at the backend or even their front-end. Take for example a company stock ticker that you may wish to have, say on your website or intranet. The data could possibly be coming from a major news site like MSN or NASDAQ. Read more »

VN:F [1.7.2_963]
Rating: 3.0/5 (1 vote cast)