title: Multipart messaging in .NET with service references c#
body: <p>I have looked for hours and haven't found an answer to what I would imagine is a somewhat common issue.</p>
  
  <p>I have a lot of data (string[2000000]) that I want to send across to a service via a service reference (asmx).  SOAP blows up because of the size right now, and I dont want to increase the pipe because tomorrow it might be 4M strings to send.</p>
  
  <p>So I was thinking multipart SOAP messages, however .NET doesn't natively support this (right?).  So how would one go about doing this?  Any help, or links would be greatly appreciated.</p>
  
  <pre><code>[WebMethod]
  public string[] returnSameStringArray(string[] string_array)
  {
      return string_array;
  }
  </code></pre>
  
  <p>Calling Code:</p>
  
  <pre><code>BasicHttpBinding basicHttpBinding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
  basicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
  basicHttpBinding.MaxReceivedMessageSize = 131072;
  
  myServiceReference = new MyService.MyServiceSoapClient(basicHttpBinding, new EndpointAddress(@"http://myaddress/myservice.asmx"));
  myServiceReference.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;
  myServiceReference.ChannelFactory.Credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
  
  string[] theStringArray = new string[2000000](); //init with something later
  theStringArray = myServiceReference.returnSameStringArray(theStringArray);
  </code></pre>