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

IOperationInvoker

 
 
Thread Tools Display Modes
Old 03-04-2006   #1 (permalink)
gregoryyoung1@gmail.com
Guest


 

IOperationInvoker

I find this to be a very interesting interface yet I am having a nearly
impossible time finding any information on it (try a google search or a
MSDN search).

It appears to allow for method interception and makes the attribute
something quite similar to an aspect.

Can anyone let me know about the context in which it is used or even
better forward me off to some places I can look up more information on
it?

Thanks in advance,

Greg

Old 03-04-2006   #2 (permalink)
Manny
Guest


 

RE: IOperationInvoker

Hi;

There is a list of blogs at

http://windowscommunication.net

the one by Ralph Squillace (http://blogs.msdn.com/ralph.squillace/) is "The
Place for Windows Communication Framework ("Indigo") Developer Documentation
and Sample Code"

There are others as well.

Regards
Manny


"gregoryyoung1@gmail.com" wrote:

> I find this to be a very interesting interface yet I am having a nearly
> impossible time finding any information on it (try a google search or a
> MSDN search).
>
> It appears to allow for method interception and makes the attribute
> something quite similar to an aspect.
>
> Can anyone let me know about the context in which it is used or even
> better forward me off to some places I can look up more information on
> it?
>
> Thanks in advance,
>
> Greg
>
>

Old 03-04-2006   #3 (permalink)
Clemens Vasters [MSFT]
Guest


 

Re: IOperationInvoker

IParameterInspector is probably a better place for interception.

Note that if you implement a parameter inspector and ypour interceptor does
not want to let the call pass because it is probably a validation thing of
some sort, you will also have to implement IErrorHandler. Here is a cleaned
out skeleton:

using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;

namespace MyStuff
{
[AttributeUsage(AttributeTargets.Interface|AttributeTargets.Class)]
public class MyBehavior : Attribute, IContractBehavior, IErrorHandler
{
#region IContractBehavior Members

//Service side hookup
public void BindDispatch(ContractDescription description,
IEnumerable<ServiceEndpoint> endpoints, DispatchBehavior dispatch,
BindingParameterCollection parameters)
{
dispatch.ErrorHandlers.Add(this);
foreach (DispatchOperation dispOp in dispatch.Operations)
{
OperationDescription operationDescription =
description.Operations.Find(dispOp.Name);
operationDescription.Faults.Add(new
FaultDescription("http://example.com/2006/01/myapp/fault"));
dispOp.ParameterInspectors.Add(new
MyParameterInspector(operationDescription));
}
}

// Proxy side hookup
public void BindProxy(ContractDescription description,
ServiceEndpoint endpoint, ProxyBehavior proxy, BindingParameterCollection
parameters)
{
foreach (ProxyOperation prxOp in proxy.Operations)
{
prxOp.ParameterInspectors.Add(new
MyParameterInspector(description.Operations.Find(prxOp.Name)));
}
}
#endregion

#region IErrorHandler Members

public bool HandleError(Exception error, MessageFault fault)
{
return (error is MyKnownExceptionType);
}

public void ProvideFault(Exception error, ref MessageFault fault,
ref string faultAction)
{
if (error is MyKnownExceptionType)
{
ConstraintViolationException constraintError = error as
ConstraintViolationException;
fault = MessageFault.CreateFault(
FaultCode.CreateReceiverFaultCode("MyError",
"http://example.com/2006/01/myapp"),
new FaultReason(constraintError.Message));
faultAction = "http://example.com/2006/01/myapp/fault";
}
else
{
fault = null;
}
}

#endregion
}
}


<gregoryyoung1@gmail.com> wrote in message
news:1138222574.167864.53750@g14g2000cwa.googlegroups.com...
>I find this to be a very interesting interface yet I am having a nearly
> impossible time finding any information on it (try a google search or a
> MSDN search).
>
> It appears to allow for method interception and makes the attribute
> something quite similar to an aspect.
>
> Can anyone let me know about the context in which it is used or even
> better forward me off to some places I can look up more information on
> it?
>
> Thanks in advance,
>
> Greg
>



 

Thread Tools
Display Modes









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