Nielsen's Weblog : .NET [use your Context dude]
Updated: 09-04-2008; 19:26:35.

 

Subscribe to "Nielsen's Weblog" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

23. januar 2008

The project we're working on currently is using ServiceAuthorizationManager for authorizing incoming request.

 

The current implementation is expecting the RequestMessage.Headers.Action field to contain the incoming soap action. Here is the catch, if you have a method that is decorated with IsOneWay=true, then guess what the RequestContext is null!...

 

This makes sense as one way calls is not the usual request/response pattern, but it sure did break our implementation :).

 

So a quick fix would be to look at the IncomingMessageHeaders instead like this:

 

  for (int i = 0; i < operationContext.IncomingMessageHeaders.Count; ++i)

  {

      MessageHeaderInfo h = operationContext.IncomingMessageHeaders[i];

      if (h.Name == "Action")

      {

          XmlReader xr = operationContext.IncomingMessageHeaders.GetReaderAtHeader(i);

          action = xr.ReadElementContentAsString();

 

 

BTW. Happy new year!, we spend the holidays in New York. We stayed at the Hilton Millenium on 54th floor. Amazing view, we had the governor suite (I think it was called that way). On my right side we could see the Brooklyn bridge, strait out the window we could see the Empire State Building (upper Manhattan) and on our left side we had the Statue of Liberty and of course Ground Zero.

 

Okay I don't get it, what fun is it standing on Times Square from 13.00 to 23.59 waiting for a ball drop ?!? J. Well glad I was watching this from my room instead J. We're definitely going to visit New York again.

 

Start spreading the news I'm leaving today … .


2:39:41 PM    comment []

© Copyright 2008 Allan Nielsen.



Click here to visit the Radio UserLand website.
 


January 2008
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Sep   Feb