Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

Intercepting WCF method invocation

 
 
Thread Tools Display Modes
Old 03-21-2007   #1 (permalink)
Stephan Zahariev
Guest


 

Intercepting WCF method invocation

Hello all,

We need to execute some code after a WCF method has finished and its reply
message is prepared.
The last thing we tried was to use an attribute which implements
IServiceBehavior and in ApplyDispatchBehavior we add a message inspector (a
class that implements IDispatchMessageInspector).
Unfortunately BeforeSendReply method is invoked proir to the serialization
of the returned objects. We need to execute some code after the
serialization - to be specific we are trying to close an NHibernate session
with Lazy Loading enabled.
Does anyone have an idea of how we can get called at the point when the
reply message is serialized?

Thanks in advance.


Old 03-21-2007   #2 (permalink)
Vadym Stetsyak
Guest


 

Re: Intercepting WCF method invocation

Hello, Stephan!

Have a look at this
(
http://blogs.msdn.com/drnick/archive...on-points.aspx )

You wrote on Wed, 21 Mar 2007 12:14:41 +0200:

SZ> We need to execute some code after a WCF method has finished and its
SZ> reply message is prepared.
SZ> The last thing we tried was to use an attribute which implements
SZ> IServiceBehavior and in ApplyDispatchBehavior we add a message
SZ> inspector (a class that implements IDispatchMessageInspector).
SZ> Unfortunately BeforeSendReply method is invoked proir to the
SZ> serialization of the returned objects. We need to execute some code
SZ> after the serialization - to be specific we are trying to close an
SZ> NHibernate session with Lazy Loading enabled.
SZ> Does anyone have an idea of how we can get called at the point when the
SZ> reply message is serialized?


With best regards, Vadym Stetsyak.
Blog: http://vadmyst.blogspot.com


Old 03-21-2007   #3 (permalink)
Stephan Zahariev
Guest


 

Re: Intercepting WCF method invocation

Hi Vadym,

Unfortunately the proposed article does not mention interception points on
the way back from the server to the client. We presume that the mechanism is
somewhat similar to the one described in the article, but still there are no
examples. We couldn't figure out how to handle our problem.

Best regards.

"Vadym Stetsyak" <vadym_s@ukr.net> wrote in message
news:%23zKWDH8aHHA.2316@TK2MSFTNGP04.phx.gbl...
> Hello, Stephan!
>
> Have a look at this
> (
> http://blogs.msdn.com/drnick/archive...on-points.aspx )
>
> You wrote on Wed, 21 Mar 2007 12:14:41 +0200:
>
> SZ> We need to execute some code after a WCF method has finished and its
> SZ> reply message is prepared.
> SZ> The last thing we tried was to use an attribute which implements
> SZ> IServiceBehavior and in ApplyDispatchBehavior we add a message
> SZ> inspector (a class that implements IDispatchMessageInspector).
> SZ> Unfortunately BeforeSendReply method is invoked proir to the
> SZ> serialization of the returned objects. We need to execute some code
> SZ> after the serialization - to be specific we are trying to close an
> SZ> NHibernate session with Lazy Loading enabled.
> SZ> Does anyone have an idea of how we can get called at the point when
> the
> SZ> reply message is serialized?
>
>
> With best regards, Vadym Stetsyak.
> Blog: http://vadmyst.blogspot.com
>



Old 03-22-2007   #4 (permalink)
Vadym Stetsyak
Guest


 

Re: Intercepting WCF method invocation

Hello, Stephan!

Here are the links that show some of WCF extensibility points

Messages filter sample
http://msdn2.microsoft.com/en-us/library/aa717046.aspx


Channels extensibility samples
http://msdn2.microsoft.com/en-us/library/aa967568.aspx

You wrote on Wed, 21 Mar 2007 18:51:20 +0200:

SZ> Unfortunately the proposed article does not mention interception points
SZ> on the way back from the server to the client. We presume that the
SZ> mechanism is somewhat similar to the one described in the article, but
SZ> still there are no examples. We couldn't figure out how to handle our
SZ> problem.

SZ> Best regards.

SZ> "Vadym Stetsyak" <vadym_s@ukr.net> wrote in message
SZ> news:%23zKWDH8aHHA.2316@TK2MSFTNGP04.phx.gbl...
??>> Hello, Stephan!
??>>
??>> Have a look at this
??>> (
??>> http://blogs.msdn.com/drnick/archive...flow-intercept
??>> ion-points.aspx ) You wrote on Wed, 21 Mar 2007 12:14:41 +0200:
SZ>>> We need to execute some code after a WCF method has finished and its
SZ>>> reply message is prepared.
SZ>>> The last thing we tried was to use an attribute which implements
SZ>>> IServiceBehavior and in ApplyDispatchBehavior we add a message
SZ>>> inspector (a class that implements IDispatchMessageInspector).
SZ>>> Unfortunately BeforeSendReply method is invoked proir to the
SZ>>> serialization of the returned objects. We need to execute some code
SZ>>> after the serialization - to be specific we are trying to close an
SZ>>> NHibernate session with Lazy Loading enabled.
SZ>>> Does anyone have an idea of how we can get called at the point when
??>> the
SZ>>> reply message is serialized?
??>>
??>> With best regards, Vadym Stetsyak.
??>> Blog: http://vadmyst.blogspot.com
??>>

With best regards, Vadym Stetsyak.
Blog: http://vadmyst.blogspot.com


Old 03-23-2007   #5 (permalink)
Stephan Zahariev
Guest


 

Re: Intercepting WCF method invocation

Thank you for the help Vadim,

I have implemented IInputSessionShutdown. Now everything works fine.

Best regards,
Stephan Zahariev

"Vadym Stetsyak" <vadym_s@ukr.net> wrote in message
news:%23O%23XqRJbHHA.3408@TK2MSFTNGP03.phx.gbl...
> Hello, Stephan!
>
> Here are the links that show some of WCF extensibility points
>
> Messages filter sample
> http://msdn2.microsoft.com/en-us/library/aa717046.aspx
>
>
> Channels extensibility samples
> http://msdn2.microsoft.com/en-us/library/aa967568.aspx
>
> You wrote on Wed, 21 Mar 2007 18:51:20 +0200:
>
> SZ> Unfortunately the proposed article does not mention interception
> points
> SZ> on the way back from the server to the client. We presume that the
> SZ> mechanism is somewhat similar to the one described in the article, but
> SZ> still there are no examples. We couldn't figure out how to handle our
> SZ> problem.
>
> SZ> Best regards.
>
> SZ> "Vadym Stetsyak" <vadym_s@ukr.net> wrote in message
> SZ> news:%23zKWDH8aHHA.2316@TK2MSFTNGP04.phx.gbl...
> ??>> Hello, Stephan!
> ??>>
> ??>> Have a look at this
> ??>> (
> ??>>
> http://blogs.msdn.com/drnick/archive...flow-intercept
> ??>> ion-points.aspx ) You wrote on Wed, 21 Mar 2007 12:14:41 +0200:
> SZ>>> We need to execute some code after a WCF method has finished and its
> SZ>>> reply message is prepared.
> SZ>>> The last thing we tried was to use an attribute which implements
> SZ>>> IServiceBehavior and in ApplyDispatchBehavior we add a message
> SZ>>> inspector (a class that implements IDispatchMessageInspector).
> SZ>>> Unfortunately BeforeSendReply method is invoked proir to the
> SZ>>> serialization of the returned objects. We need to execute some code
> SZ>>> after the serialization - to be specific we are trying to close an
> SZ>>> NHibernate session with Lazy Loading enabled.
> SZ>>> Does anyone have an idea of how we can get called at the point when
> ??>> the
> SZ>>> reply message is serialized?
> ??>>
> ??>> With best regards, Vadym Stetsyak.
> ??>> Blog: http://vadmyst.blogspot.com
> ??>>
>
> With best regards, Vadym Stetsyak.
> Blog: http://vadmyst.blogspot.com
>



 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Method invocation failed because [System.String] doesn't contain a method B Williams PowerShell 0 03-31-2008 06:00 PM
Method invocation failed B Williams PowerShell 0 03-31-2008 05:46 PM
Remote invocation of ps commands? Duncan Smith PowerShell 5 10-05-2007 12:12 PM
Function names and invocation Hans Dingemans PowerShell 3 09-26-2007 01:12 AM
COM IDispatch and Powershell invocation =?Utf-8?B?S2Jnbw==?= PowerShell 1 09-12-2006 01:54 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50