title: Unable to set CookieContainer on service client in MonoTouch
body: <p>I have a MonoTouch project using some code I share with a Windows Phone 7 app. This shared code creates a WCF proxy for a RIA Domain Service (using the /Soap endpoint), generated using SLSvcUtil.exe. This is what the code looks like:</p>
  
  <pre><code>BasicHttpBinding binding = new BasicHttpBinding();
  EndpointAddress address = new EndpointAddress("http://someurl/someservice.svc");
  
  var client = new MyDomainServiceSoapClient(binding, address);
  client.CookieContainer = _cookieContainer; // &lt;-- EXCEPTION here
  </code></pre>
  
  <p>This piece of code works in WP7, but fails in MonoTouch, and I can't find why. The exception I get in MonoTouch is:</p>
  
  <pre><code>System.InvalidOperationException: Unable to set the CookieContainer.
  Please make sure the binding contains an HttpCookieContainerBindingElement.
      at MyDomainServiceSoapClient.set_CookieContainer
  </code></pre>
  
  <p>I have tried the following options before setting the CookieContainer, but still the same error:</p>
  
  <pre><code>binding.EnableHttpCookieContainer = true;
  binding.AllowCookies = true;
  binding.CreateBindingElements()
      .Add(new HttpCookieContainerBindingElement()); // ??
  </code></pre>
  
  <p>Update: I have also tried building a CustomBinding by hand and adding an HttpCookieContainerBindingElement but this also won't work.</p>
  
  <p>Any ideas? The MonoTouch site tells me that the WCF implementation is "experimental", so maybe this is a limitation in the current version of MonoTouch?</p>