May 2003 - Posts

Last night I went to a presentation of Ingo Rammer about Remoting vs. Webservices, in Brussels, organised by the Belgian .NET Usergroup (BENUG) and sponsored by Ineta. The first part of the presentation was about Webservices (the usual stuff), and the second part was about Remoting (which was the reason I think, that people wanted to see this presentation because Ingo is known as a Remoting guy). Ingo did a nice job explaining the Remoting basics: creating servers/clients, registering channels, client activated, ...

After the presentation, he mentioned an article on his website about the performance differences between Webservices and Remoting, which I did not know (yet). It compares Webservices to Remoting (both in and out IIS), and shows that Remoting with a TCP channel is the way to go if you want pure performance. However I was surprised that in some case Remoting hosted in IIS, is not really faster then Webservices.

Btw: I have to say that if there were competitions held for typing code, Ingo could have the world record! Man, he types really fast... ;-)

Hi all .NET-folks out there! Since I really feel like being a part of this great community, I would like to announce my marriage! Yes, I'm going to get married on the 12th of July with Nele. Ofcourse (as a software engineer I had to) I've made a website with some info about us. I really would appriciate if you guys and girls could sign the guestbook. Since the site is in Dutch, I think most of you don't understand al the topics, but if you are intrested, feel free to take a look. Anyway thanks in advance for your intrest and/or nice words!

Roy Osherove posted a link to some cool Registry settings. One of them I found quite usefull: Enable AutoCompletion in Command Prompt. Once this setting is done, you can use the tab key for autocompleting while typing in the command prompt (cmd)! For example you type "cd c:\progr" (without return) and press the tab key, "progr" will be completed to "Program Files".

To enable this setting, change the following key in the registry:
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar
Change this value (or create the key, DWORD) to 9.

Maybe you've read my post about the problems I had while using a custom SoapExtension class. Thanks to an anonymous reaction, I found the sollution!! I was testing the webservice by using the default test page from Internet Explorer, but the testpage in IE uses the GET protocol, not the SOAP protocol. So there was nothing wrong with my code (I started believing I really sucked ;-), I only had to make a very simple test application. Thanks again to the person who submitted this tip!

So the result was that I had an application that showed the encrypted data... After some searching I discovered that I needed to alter the Reference.vb file manually and add an extra attribute on the Webservice proxy method:

<System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/TestEncr/Service1/TestMe", RequestNamespace:="http://tempuri.org/TestEncr/Service1", ResponseNamespace:="http://tempuri.org/TestEncr/Service1", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped) _
, EncryptionExtension(decrypt:=DecryptMode.Response)> _
Public Function TestMe() As String
   Dim results() As Object = Me.Invoke("TestMe", New Object(-1) {})
   Return CType(results(0), String)
End Function

It's great to have such a nice community of people to help you out!

UPDATE: Problem solved!!

I'm trying to use the example on MSDN Encrypting SOAP Messages. I've spent quite some time trying to make this work, but I think I missed something... The article describes how to make a custom SoapExtension class that encrypts Soap messages. I thought I only needed to include the dll (downloaded from GotDotNet), and add an attribute to my WebMethod:

_

Public Function TestMe() As String

Return "Test..."

End Function

But, whatever I try, if I test my webservice in IE, the response is always plain, readable text... Does anyone has any experience with this? I really would appriciate some help! Thanks!!

I don't know if something like this exists, or even is available in the .NET Framework itself, but I had to make a routine to sort a collection of objects, so I built a simple comparer class. The comparer class can be used like this:
Dim customers As New ArrayList

'Or you can use the Sort method of the strong typed collection,
'inheriting from CollectionBase.

customers.Sort(New SimpleComparer("Name"))
'or
customers.Sort(New SimpleComparer("Name", SortOrder.Descending))





The complete code for SimpleComparer class is:
    Public Class SimpleComparer

Implements IComparer

Private _propertyToSort As String
Private _sortOrder As SortOrder

Public Sub New(ByVal propertyToSort As String)
Me.new(propertyToSort, System.Windows.Forms.SortOrder.Ascending)
End Sub

Public Sub New(ByVal propertyToSort As String, ByVal sortOrder As SortOrder)
MyBase.new()
_propertyToSort = propertyToSort
_sortOrder = sortOrder
End Sub

Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer _
Implements System.Collections.IComparer.Compare
Dim prop As Reflection.PropertyInfo = x.GetType.GetProperty(Me.PropertyToSort)

If Me.SortOrder = SortOrder.None OrElse prop.GetValue(x, Nothing) = _
prop.GetValue(y, Nothing) Then
Return 0
Else
If prop.GetValue(x, Nothing) > prop.GetValue(y, Nothing) Then
If Me.SortOrder = System.Windows.Forms.SortOrder.Ascending Then
Return 1
Else
Return -1
End If
Else
If Me.SortOrder = System.Windows.Forms.SortOrder.Ascending Then
Return -1
Else
Return 1
End If
End If
End If
End Function

Public Property SortOrder() As SortOrder
Get
Return _sortOrder
End Get
Set(ByVal Value As SortOrder)
_sortOrder = Value
End Set
End Property

Public Property PropertyToSort() As String
Get
Return _propertyToSort
End Get
Set(ByVal Value As String)
_propertyToSort = Value
End Set
End Property
End Class


More Posts