title: WCF Service Proxy throws exception when more than one parameter is used in [OperationContract] method
body: <p>I have a WebServiceHost that is being used to host some web services in a console app. I added a service reference to it in my client app and create the proxy like so:</p>
  
  <pre><code>var binding = new WebHttpBinding();
  var endPoint = new EndpointAddress(string.Format(Settings.serviceBase, Settings.wcfPort));
  
  ChannelFactory&lt;IzWaveSVC&gt; factory = new ChannelFactory&lt;IzWaveSVC&gt;(new WebHttpBinding(), endPoint);
  
  factory.Endpoint.Behaviors.Add(new WebHttpBehavior());
  // **Exception occurs here**
  var proxy = (IzWaveSVC)factory.CreateChannel();
  </code></pre>
  
  <p>It works, but once I added a new method that requires more than one parameter, I started getting this exception when the proxy was created (this was before any communication even took place):</p>
  
  <pre><code>Operation 'setDeviceState' of contract 'IzWaveSVC' specifies multiple request 
  body parameters to be serialized without any wrapper elements. At most one 
  body parameter can be serialized without wrapper elements. Either remove the 
  extra body parameters or set the BodyStyle property on the WebGetAttribute / 
  WebInvokeAttribute to Wrapped.
  </code></pre>
  
  <p>Adding a WebInvokeAttribute and setting the BodyStyle to wrapped has no effect: </p>
  
  <pre><code>[OperationContract]
  [WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped)]        
  bool setDeviceState(byte nodeId, bool powered, byte level);
  </code></pre>
  
  <p>It should be noted that I have other methods that work, but they only have a single parameter so they don't have the above problem.</p>
  
  <p>Just FYI, here's how I setup the host:</p>
  
  <pre><code>endPoint = new EndpointAddress(string.Format(Settings.serviceBase, port));
  binding = new WebHttpBinding();
  
  host = new WebServiceHost(singletonObject, new Uri(string.Format(Settings.serviceBase, port)));
  
  host.AddServiceEndpoint(typeof(IzWaveSVC), binding, ""); 
  ServiceMetadataBehavior mexBehavior = new ServiceMetadataBehavior();                
  mexBehavior.HttpGetEnabled = true;
  host.Description.Behaviors.Add(mexBehavior);                
  host.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding(), endPoint.Uri.AbsoluteUri + "mex");    
  host.Open();            
  </code></pre>
  
  <p>Any help is appreciated. </p>
  
  <p>Thanks!</p>