title: get Dataset from web service
body: <p>Here's the case:
  I developed a web service which simply gets string arguments and returns <code>DataSet</code>:</p>
  
  <pre><code>[WebMethod]
          public DataSet login(string strClientCertificate, string strClientChallengeSigned, string MsgChallenge, string rndNum)
  </code></pre>
  
  <p>I want to consume this web service in client side so I prepared arguments and sent it to my referenced web service:</p>
  
  <p>in client side:</p>
  
  <pre><code>DataSet xmlResponse = new DataSet();
  
  MySrvRef.StockServiceSoapClient proxy2 = new StockServiceClient.MySrvRef.StockServiceSoapClient();
  
  xmlResponse = proxy2.login(strCert, strSignedMsg, message, randomNum);
  </code></pre>
  
  <p>All I want is showing xmlResponse to client, but I've got this error in VS2008:</p>
  
  <blockquote>
    <p>An unhandled exception of type 'System.ServiceModel.ProtocolException'
    occurred in mscorlib.dll</p>
    
    <p>Additional information: The remote server returned an unexpected
    response: (400) Bad Request.</p>
  </blockquote>
  
  <p>I am totally confused. Any ideas?</p>
  
  <p><strong>[EDIT1]</strong></p>
  
  <p>I've already changed the content length in <code>app.config</code> file in client side:</p>
  
  <pre><code>&lt;basicHttpBinding&gt;
                  &lt;binding name="StockServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
                      receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
                      bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                      maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
                      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                      useDefaultWebProxy="true"&gt;
                      &lt;readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
                          maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
                      &lt;security mode="None"&gt;
                          &lt;transport clientCredentialType="None" proxyCredentialType="None"
                              realm="" /&gt;
                          &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
                      &lt;/security&gt;
                  &lt;/binding&gt;
              &lt;/basicHttpBinding&gt;
  </code></pre>
  
  <p><strong>[EDIT 2]</strong>
  I even changed my method to simple string return method:</p>
  
  <pre><code>[WebMehod]
     public string login(string x, string y, string z, string w)
     {
         return "yes";
     }
  </code></pre>
  
  <p>call it from client side but got the same protocol exception :( .</p>
  
  <p>I have another method in my service which is defined as:</p>
  
  <pre><code>   [WebMehod]
         public byte[] getChallenge()
  </code></pre>
  
  <p>and I call it without any problem in client side.</p>