[Mono-bugs] [Bug 679702] New: WCF endpoint behaviors not applied

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Mar 15 06:31:11 EDT 2011



           Summary: WCF endpoint behaviors not applied
    Classification: Mono
           Product: MonoTouch
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: anthony at caterxpress.com
         QAContact: mono-bugs at lists.ximian.com
                CC: anthony at caterxpress.com
          Found By: Community User
           Blocker: ---

We are attempting to access WCT REST services via MonoTouch, which requires us
to use a different binding than the standard WSHttpBinding. Our binding must
use manual addressing due to the nature of REST services, which can only be
achieved by adding a behavior to the binding.

However due to a compiler directive in 
System.ServiceModel.Description.ServiceEndpoint, no behaviors are ever applied
to a binding:

        internal ClientRuntime CreateRuntime ()
            ServiceEndpoint se = this;

            var proxy = se.Contract.CreateClientRuntime ();

#if !NET_2_1
            foreach (IEndpointBehavior b in se.Behaviors)
                b.ApplyClientBehavior (se, proxy);
            foreach (IContractBehavior b in se.Contract.Behaviors)
                b.ApplyClientBehavior (se.Contract, se, proxy);
            return proxy;

Without these you cannot control manual addressing, such as setting the "To" 
message header (among many other things you can't do). In Silverlight, WCF
behaviors are fully supported.

In the ChannelFactory class, you have allowed another behavior method to be
executed by including monotouch in the directive:

        BindingParameterCollection CreateBindingParameters ()
#if !NET_2_1 || MONOTOUCH
            foreach (IEndpointBehavior behavior in Endpoint.Behaviors)
                behavior.AddBindingParameters (Endpoint, pl);

            return pl;

I'm hoping you can also add MONOTOUCH to the directive in
ServiceEndpoint.CreateRuntime(). Without this it's virtually impossible to use
alternate WCF bindings & behaviors.

For completeness, I also suggest adding the MONOTOUCH directive to the Validate
method in the ServiceEndpoint class.


Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list