none
Can 4.5 async WCF proxies be used with the Silverlight 5 async targeting pack? RRS feed

  • Question

  • Question sums it up

    I generate a proxy in 4.5 (works great...), push it to Silverlight with async pack

    I get this error when I try to create the proxy:

    System.InvalidOperationException: The contract 'ISomeService' contains synchronous operations, which are not supported in Silverlight. Split the operations into "Begin" and "End" parts and set the AsyncPattern property on the OperationContractAttribute to 'true'. Note that you do not have to make the same change on the server.

    at System.ServiceModel.ChannelFactory.OnOpening() at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.ChannelFactory.EnsureOpened() at System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via) at System.ServiceModel.ChannelFactory`1.CreateChannel()

    Of course setting to true does nothing... (different exceptions...)

    Is there some magic pack for WCF? Am I not using right version? Does it just not work?

    Code reference if it helps... names changed to protect the innocent :)

    //------------------------------------------------------------------------------
    // <auto-generated>
    //     This code was generated by a tool.
    //     Runtime Version:4.0.30319.18033
    //
    //     Changes to this file may cause incorrect behavior and will be lost if
    //     the code is regenerated.
    // </auto-generated>
    //------------------------------------------------------------------------------
    
    namespace ServiceClient
    {
        [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
        [System.ServiceModel.ServiceContractAttribute(ConfigurationName = "ServiceClient.ISomeService")]
        public interface ISomeService
        {
    
            [System.ServiceModel.OperationContractAttribute(Action = "http://somedomain.com/ISomeService/InvokeLogicGroup", ReplyAction = "http://somedomain.com/ISomeService/InvokeLogicGroupResponse")]
            SomeNS.ReturnType[] InvokeLogicGroup(bool useTransaction, SomeNS.InvokerContext invokerContext, bool allOrNothing, SomeNS.InvokerParameter[] invokerParams);
    
            [System.ServiceModel.OperationContractAttribute(Action = "http://somedomain.com/ISomeService/InvokeLogicGroup", ReplyAction = "http://somedomain.com/ISomeService/InvokeLogicGroupResponse")]
            System.Threading.Tasks.Task<SomeNS.ReturnType[]> InvokeLogicGroupAsync(bool useTransaction, SomeNS.InvokerContext invokerContext, bool allOrNothing, SomeNS.InvokerParameter[] invokerParams);
        }
    
        [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
        public interface ISomeServiceChannel : ServiceClient.ISomeService, System.ServiceModel.IClientChannel
        {
        }
    
        [System.Diagnostics.DebuggerStepThroughAttribute()]
        [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
        public partial class SomeServiceClient : System.ServiceModel.ClientBase<ServiceClient.ISomeService>, ServiceClient.ISomeService
        {
    
            public SomeServiceClient()
            {
            }
    
            public SomeServiceClient(string endpointConfigurationName) :
                base(endpointConfigurationName)
            {
            }
    
            public SomeServiceClient(string endpointConfigurationName, string remoteAddress) :
                base(endpointConfigurationName, remoteAddress)
            {
            }
    
            public SomeServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
                base(endpointConfigurationName, remoteAddress)
            {
            }
    
            public SomeServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
                base(binding, remoteAddress)
            {
            }
    
            public SomeNS.ReturnType[] InvokeLogicGroup(bool useTransaction, SomeNS.InvokerContext invokerContext, bool allOrNothing, SomeNS.InvokerParameter[] invokerParams)
            {
                return base.Channel.InvokeLogicGroup(useTransaction, invokerContext, allOrNothing, invokerParams);
            }
    
            public System.Threading.Tasks.Task<SomeNS.ReturnType[]> InvokeLogicGroupAsync(bool useTransaction, SomeNS.InvokerContext invokerContext, bool allOrNothing, SomeNS.InvokerParameter[] invokerParams)
            {
                return base.Channel.InvokeLogicGroupAsync(useTransaction, invokerContext, allOrNothing, invokerParams);
            }
        }
    }


    Wednesday, June 5, 2013 10:27 PM

Answers

All replies