Emil’s Blog

Programming Windows, .Net, EPiServer and whatnot…

[Powered by WordPress.]

February 17, 2006

List web applications in IIS and their ASP.NET versions

by @ 11:15. Filed under Windows tips
C:\>aspnet_regiis.exe  -lk
W3SVC/  1.1.4322.0
W3SVC/1/ROOT/Butler/UtbildareSI/        2.0.50727.42
W3SVC/1/ROOT/Butler/SecuritySI/ 2.0.50727.42
W3SVC/1/ROOT/Butler/Public.SecuritySI2.0.50727.42
W3SVC/1/ROOT/Butler/PersonregisterSI/   2.0.50727.42
W3SVC/1/ROOT/Butler/CommonEntity/       2.0.50727.42
W3SVC/1/ROOT/Reports$SQL2005/   2.0.50727.42
W3SVC/1/ROOT/ReportServer$SQL2005/      2.0.50727.42

C:\>

February 9, 2006

How to: Migrate Visual Studio .NET 2003 Add-ins to Visual Studio 2005

by @ 14:05. Filed under Visual Studio tips

Here's a description of how to upgrade old add-in projects from Visual Studio 2003 to 2005:

http://msdn2.microsoft.com/en-us/library/ms165634.aspx

February 2, 2006

SoapHeaders to Web Services in .Net

by @ 14:49. Filed under .Net programming

SoapHeaders can be used to send "extra" and optional parameters to web service methods and is a technique which can be extremely useful. See the following example:

Server-side (MyService.asmx):

public class MyService : System.Web.Services.WebService
{
   public class AddDateHeader : SoapHeader
   {
      public bool AddDate;
   }
   public AddDateHeader myheader;
   ...

   [WebMethod]
   [SoapHeader("myheader")]
   public string HelloWorld()
   {
      if (myheader != null && myheader.AddDate == true)
         return "Hello World " + DateTime.Now.ToString();
      else
         return "Hello World";
   }

Client-side:

localhost.MyService si = new localhost.MyService();
si.AddDateHeaderValue = new localhost.AddDateHeader();
si.AddDateHeaderValue.AddDate = true;
MessageBox.Show(si.HelloWorld());

Furthermore, these headers can be accessed in SoapExtension components. For example, there might be a SoapHeader that controls the transport of data.

Example:

Public Overrides Sub ProcessMessage(ByVal message As SoapMessage)
    Dim compress As Boolean = False
    Dim header As SoapHeader
    For Each header In message.Headers
        If header.GetType().Name = "Compress" Then
            compress = True
        End If
    Next
    ...

Sometimes it's useful to have the header sent in both directions (both to and from the service). In this case, apply the attribute to the web method with the Direction attribute:

[SoapHeader("myheader", Direction = SoapHeaderDirection.InOut)]
public string HelloWorld()
{
    ...

[powered by WordPress.]

jour·nal n. A personal record of occurrences, experiences, and reflections kept on a regular basis; a diary.

Internal links:

Categories:

Search blog:

Archives:

February 2006
M T W T F S S
« Jan   Mar »
 12345
6789101112
13141516171819
20212223242526
2728  


View Emil Åström's profile on LinkedIn

General links:

I read:

Visitors

Recent Comments

Spam caught

Other:

Clicky Web Analytics

36 queries. 0.376 seconds