Monday, January 26, 2004 - Posts

Ping Weblogs.com using XML-RPC and VB.NET

From a great idea of John R. Lewis and Patrick Santry, here there's a great way to notify weblogs.com (the list of recently updated Blogs) whenever there is an update on your blog. This solution uses the XML-RPC.Net library from Cook Computing.. Here's the code:

First I created a new class for my directory for handling the XML-RPC methods. The code is similar to John's code, but in VB.

Imports CookComputing.XmlRpc
Imports System
Namespace DotNetJunkies
   Public Class RDMWeblogsDB
      Public Function Ping(ByVal WeblogName As String, ByVal WeblogURL As String) As WeblogsUpdateResponse
         Dim proxy As IWebLogsUpdate
         proxy = XmlRpcProxyGen.Create(
GetType(IWebLogsUpdate))
         Return proxy.Ping(WeblogName, WeblogURL)
      End Function
      Structure WeblogsUpdateResponse
         Public flerror As Boolean
         Public message As String
      End Structure
      <XmlRpcUrl("http://rpc.weblogs.com/RPC2")> Public Interface IWebLogsUpdate
        <XmlRpcMethod("weblogUpdates.ping")>
Function Ping(ByVal WeblogName As String, ByVal WeblogURL As String) As WeblogsUpdateResponse
      End Interface
   End Class
End
Namespace

Then in your edit class just call the class in an onClick event:

Private Sub cmdPingWeblogs_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdPingWeblogs.Click
   Dim objPing As New RDMWeblogsDB
   Dim sResponse As DotNetJunkies.RDMWeblogsDB.WeblogsUpdateResponse
   sResponse = objPing.Ping("
DotNetJunkies - Stefano Demiliani WebLog", http://dotnetjunkies.com/WebLog/demiliani/)
  
End Sub

Secure ASP 3.0 with .NET forms authentication

Andrew Seven provided a great solution to secure ASP 3 pages using .Net forms authentication (the reason can be simply because you don't want or can't change your existing code).

You can follow the thread on Paschal L Blog HERE, and you can also download the ZIP solution HERE.

MSN Toolbar vs Google Toolbar

Today I've checked the new MSN toolbar...

Find it fast with the MSN Toolbar!

It's quite good, expecially for the Quick Links to launch MSN Hotmail, MSN Messenger, and your personalized MSN home page, Pop-Up Guard works good.

However, I think that the Google Toolbar is better, expecially for the search capabilities of the Google Search Engine... this is a tool that you must have!

UPDATE:

Seems Yahoo! is getting in the act with the “Companion” bar:

Yahoo! Companion

Data Access and Storage Developer Center is born...

The new Data Access and Storage Developer Center  at MSDN was finally launched this morning... I think it would be a great place to understand the world of database programming in SQL Server "Yukon". Check it soon, great articles will wait you...

Microsoft Win32 to Microsoft .NET Framework API Map

An interesting article that identifies the Microsoft .NET Framework version 1.0 or 1.1 APIs that provide similar functionality to Microsoft Win32 functions. One or more relevant .NET Framework APIs are shown for each Win32 function listed. Microsoft® Win32® functions are organized by category. Each Win32 function that is listed belongs to only one category, and each category is presented in its own table.

Check it soon HERE!

GAIM Blogger

I've just tested the Gaim Blogger plugin of the Gaim Instant Messaging client, a multiplatform client that supports multiple protocols at once (ICQ, MSN, Jabber, Aim, Yahoo, IRC and more).

This plugin implements the Xml-Rpc Blogger API 1.0, published by Blogger. It seems work quite good.

I think would be interesting a .TEXT version of this plugin :)

Free Ebook on Active Directory

An interesting free Ebook (.chm format) on Active Directory Troobleshooting from NetPro...

  • The Tips and Tricks Guide to Active Directory Troubleshooting
  • The Definitive Guide to Active Directory Troubleshooting

These books share the best practices, tips and tricks, step-by-step testing procedures, and diagnostic approaches that will help you to ensure the reliability and performance of your directory all the time. Interesting!!

SOAP Headers and Security

A way to ensure security for your Web Service is the use of SOAP Headers.

If a client is consuming a Web Service, with SOAP Headers it can send additional informations, such as Username and Password for a user, that are added to the Web Service request. The advantage is that SOAP Headers can be sent only from the client and cannot be set from the public web interface of the .NET Framework.

- To use a SOAP Header we must import the System.Web.Services.Protocols namespace.

Using System.Web.Services.Protocols;

- To implement our header we have to build a class derived from SoapHeader and add the 2 objects Username e Password, like this:

// SOAP Header for authentication

public class myHeader : SoapHeader

{

public string Username;

public string Password;

}

- Now we have to create a method for our Web Service that checks the user access credentials; to do this we have to create an instance of myHeader, and after that we can use it in our function like below:

// Instance of myHeader

public myHeader sHeader;

- To use the header in our methods, we must specify (for each one) the WebMethod and SoapHeader() attributes, with the name of the header object:

[WebMethod(Description="Check Authentication Header")]

[SoapHeader("sHeader")]

- Now we can build a function to check the header sent from a client. To retrieve Username and Password of the user, we can simply use our myHeader object:

//Retrieves Username and Password

string usr = sHeader.Username;

string pwd = sHeader.Password;

and so we can use this fields as you want...

The SOAP declaration of the service is this:

 

- Obviously, we must have a client that consumes this service:

// Web Service object

soapHeadercsharp.service1 myService = new soapHeadercsharp.service1();

// SOAP Header for user authentication

soapHeadercsharp.myHeader myHeader = new soapHeadercsharp.myHeader ();

- Now we can use this service in our client application like below:

myHeader.Username = strLoginUtente; //set Username

myHeader.Password = strPassUtente; //set Password

//Set the Web Service Header

wsrvMessaggi.myHeaderValue = myHeader;

//Call the Web Service method

return myService.checkHeader();

 

I think that this method could be a good way to send User details. The only limitation is that the SOAP Header is "clear" and so is better to use Secure Sockets Layer (SSL) on HTTPS protocol to access this service.

UPDATE:

John Bristowe correctly suggests me the usage of  Web Service Enhancements to improve security... yes, I think it's a good idea.

With WSE you can sign a message with a SecurityToken such as a user-specific token (e.g. UsernameToken, or user-specific KerberosToken) , like this:

// Create an instance of the proxy
WeblogProxy proxy = new WeblogProxy();

// Create a KerberosSecurityToken
string targetPrincipal = "host/" + new Uri( proxy.Url ).Host;
KerberosToken token = new KerberosToken( targetPrincipal );

// Add the SecurityToken to the Request Context
proxy.RequestSoapContext.Security.Tokens.Add( token );

// Sign the message with a signature object 
Signature sig = new Signature( token );
proxy.RequestSoapContext.Security.Elements.Add( sig );

 

More information HERE!


 


 

Is it true?

.TEXT integration with DotNetNuke

Christoc has implemented a .Text integration for DotNetNuke, cDotText. This package is a simple solution to semi-integrate .Text blogs into DotNetNuke.

It currently allows for three things:

  • Registered users of a DNN site to create their own blog.
  • Site administrators can list off the users who have blogs, the number of blog posts per user, and the last post for a user.
  • Site admins can display the Aggregate feed from .Text blogs into the DotNetNuke framework, either in a full text listing, or just a link to the most recent blogs.

cDotText is available for download at DnnCart.com, it's still quite limited, but for the most part stable.