Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Indigo

Vista - IOperationInvoker

 
 
Old 03-04-2006   #1 (permalink)
gregoryyoung1@gmail.com


 
 

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


My System SpecsSystem Spec
Old 03-04-2006   #2 (permalink)
Manny


 
 

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
>
>

My System SpecsSystem Spec
Old 03-04-2006   #3 (permalink)
Clemens Vasters [MSFT]


 
 

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
>



My System SpecsSystem Spec
 

Thread Tools



Vista Forums 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 Ltd

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