Michel,
I don't know VB syntax, sorry. I used the two C#-to-VB converters to create the code snippet, and they both produced the same code. Anyway, the problem is that you need to instantiate the loContext object and you haven't done that. You've just defined it as SoapContext.
~~Bonnie
>>You forgot to instantiate the object. Here's the correct code (plus the checking for nothing if you still want to do that):
>>
>>Dim loContext As SoapContext
>>loContext = New SoapContext()
>>If Not (loContext Is Nothing) Then
>> loContext = HttpSoapContext.ResponseContext
>>End If
>>
>
>This generates an error on the 2nd line. First, the parentheses are not kept. Then, the error is underlining "New SoapContext".