SOAPExtensions and WSE

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,
I have created a UsernameTokenManager class for proceesing UsernameToken
details. This works well. I have the configuration set up in my web.config
because I want the authentication to apply to all methods.

I have also created another extension which checks whether a user has
permission to call a web method. This consists of searching (no modification
is done) the SOAPMessage xml and retreiving the username from the xml and
the soap action, then querying whether the user has permission. If I only
use my permission extension (the second one) it works as expected (i.e. It
falls over when my code checks for a RequestContext ).

My problem is the following:

1. If I leave the settings in terms of priority(1) and group(0) the
UsernameToken Manager works ok and processes the security details. I then
get an error saying "object reference not set", this (I think) has to do
with the fact that I use an XPath expression to retreive some details from
the security header xml which have been removed by the first extension
processing. Ok. I then set the priority to 0 for my permissions extension
and to 1 for the UsernameToken manager.
2. This then reports to me that the root node is not found. This is because
the Stream is length 0.

My question is....what happens to the SOAPMessage stream?? I am pretty sure
the PermissionExtension is invoked first (no debug info is written for the
UsernameTokenManager implementation). I check the length in the
ProcessMessage method at it is length 0! This is before I do anything!
As I said above, if I remove ALL traces of the UsernameTokenManager
reference from the Web.config it works (withint he boundaries mentioned
above).

Any help greatly appreciated..




.



Relevant Pages

  • Re: SOAPExtensions and WSE
    ... permission to call a web method. ... modification is done) the SOAPMessage xml and retreiving the username ... If I only use my permission extension it ... UsernameTokenManager implementation). ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: SOAPExtensions and WSE
    ... can't see why my stream is zero when I try to invoke my extension. ... >> permission to call a web method. ... >> UsernameTokenManager implementation). ...
    (microsoft.public.dotnet.framework.webservices.enhancements)