Getting "(400) Bad Request" exception on VS Development Server in Windows 7I have a bare-bones WCF service and client that fail when using the Visual Studio Development Server in Windows 7. I get the following exception:<br><br><div style="overflow:auto;background-color:white;line-height:100% ! important;font-family:Courier New;font-size:11px"><table style="border-width:0px;margin:2px 0px;width:99%;border-collapse:collapse;background-color:rgb(255, 255, 255)" cellpadding=0 cellspacing=0><col style="font-family:Courier New;font-size:11px;padding-left:10px;white-space:nowrap"><tbody><tr><td><font style="font-size:11px">The remote server returned an error: (400) Bad Request. </font></td></tr></tbody></table></div><br><br>The inner exception from tracing:<br><div style="overflow:auto;background-color:white;line-height:100% ! important;font-family:Courier New;font-size:11px"><table style="border-width:0px;margin:2px 0px;width:99%;border-collapse:collapse;background-color:rgb(255, 255, 255)" cellpadding=0 cellspacing=0><col style="font-family:Courier New;font-size:11px;padding-left:10px;white-space:nowrap"><tbody><tr><td><font style="font-size:11px"></font><font style="color:blue">&lt;</font><font style="font-size:11px">InnerException</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">    &lt;</font><font style="font-size:11px">ExceptionType</font><font style="color:blue">&gt;</font><font style="font-size:11px">System.Xml.XmlException, System.Xml, </font><font style="color:red">Version</font><font style="font-size:11px">=</font><font style="color:blue">2</font><font style="font-size:11px">.0.0.0, </font><font style="color:red">Culture</font><font style="font-size:11px">=</font><font style="color:blue">neutral</font><font style="font-size:11px">, </font><font style="color:red">PublicKeyToken</font><font style="font-size:11px">=</font><font style="color:blue">b77a5c561934e089</font><font style="font-size:11px">&lt;/</font><font style="color:black;font-weight:bold">ExceptionType</font><font style="font-size:11px">&gt; </font></td></tr><tr><td><font style="color:blue">    &lt;</font><font style="font-size:11px">Message</font><font style="color:blue">&gt;</font><font style="font-size:11px">The body of the message cannot be read because it is empty.</font><font style="color:blue">&lt;/</font><font style="font-size:11px">Message</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">    &lt;</font><font style="font-size:11px">StackTrace</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>at System.ServiceModel.Channels.HttpRequestContext.CreateMessage() </td></tr><tr><td style="background-color:rgb(247, 247, 247)">at System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(HttpRequestContext context, ItemDequeuedCallback callback) </td></tr><tr><td>at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result) </td></tr><tr><td style="background-color:rgb(247, 247, 247)">at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() </td></tr><tr><td>at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() </td></tr><tr><td style="background-color:rgb(247, 247, 247)">at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state) </td></tr><tr><td>at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke2() </td></tr><tr><td style="background-color:rgb(247, 247, 247)">at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke() </td></tr><tr><td>at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ProcessCallbacks() </td></tr><tr><td style="background-color:rgb(247, 247, 247)">at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.CompletionCallback(Object state) </td></tr><tr><td>at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) </td></tr><tr><td style="background-color:rgb(247, 247, 247)">at System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) </td></tr><tr><td>at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) </td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">    &lt;/</font><font style="font-size:11px">StackTrace</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td><font style="color:blue">    &lt;</font><font style="font-size:11px">ExceptionString</font><font style="color:blue">&gt;</font><font style="font-size:11px">System.Xml.XmlException: The body of the message cannot be read because it is empty.</font><font style="color:blue">&lt;/</font><font style="font-size:11px">ExceptionString</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">&lt;/</font><font style="font-size:11px">InnerException</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr></tbody></table></div><br><br><br>The identical code works fine when using the Visual Studio Development Server in Vista, or IIS7 in either Vista or Windows 7. Any ideas?<br><br>IService1.cs:<br><div style="overflow:auto;background-color:white;line-height:100% ! important;font-family:Courier New;font-size:11px"><table style="border-width:0px;margin:2px 0px;width:99%;border-collapse:collapse;background-color:rgb(255, 255, 255)" cellpadding=0 cellspacing=0><col style="font-family:Courier New;font-size:11px;padding-left:10px;white-space:nowrap"><tbody><tr><td><font style="font-size:11px"></font><font style="color:blue">using</font><font style="font-size:11px"> System.ServiceModel; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"> </td></tr><tr><td><font style="color:blue">namespace</font><font style="font-size:11px"> TestService </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">{ </td></tr><tr><td>    [ServiceContract] </td></tr><tr><td style="background-color:rgb(247, 247, 247)">    <font style="color:blue">public</font><font style="font-size:11px"> </font><font style="color:blue">interface</font><font style="font-size:11px"> IService1 </font></td></tr><tr><td>    { </td></tr><tr><td style="background-color:rgb(247, 247, 247)">        [OperationContract] </td></tr><tr><td>        <font style="color:blue">string</font><font style="font-size:11px"> GetData(</font><font style="color:blue">int</font><font style="font-size:11px"> value); </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">    } </td></tr><tr><td>} </td></tr><tr><td style="background-color:rgb(247, 247, 247)"> </td></tr></tbody></table></div><br>Service1.svc.cs:<br><div style="overflow:auto;background-color:white;line-height:100% ! important;font-family:Courier New;font-size:11px"><table style="border-width:0px;margin:2px 0px;width:99%;border-collapse:collapse;background-color:rgb(255, 255, 255)" cellpadding=0 cellspacing=0><col style="font-family:Courier New;font-size:11px;padding-left:10px;white-space:nowrap"><tbody><tr><td><font style="font-size:11px"></font><font style="color:blue">namespace</font><font style="font-size:11px"> TestService </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">{ </td></tr><tr><td>    <font style="color:blue">public</font><font style="font-size:11px"> </font><font style="color:blue">class</font><font style="font-size:11px"> Service1 : IService1 </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">    { </td></tr><tr><td>        <font style="color:blue">public</font><font style="font-size:11px"> </font><font style="color:blue">string</font><font style="font-size:11px"> GetData(</font><font style="color:blue">int</font><font style="font-size:11px"> value) </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        { </td></tr><tr><td>            <font style="color:blue">return</font><font style="font-size:11px"> </font><font style="color:blue">string</font><font style="font-size:11px">.Format(</font><font style="color:blue">&quot;You entered: {0}&quot;</font><font style="font-size:11px">, value); </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        } </td></tr><tr><td>    } </td></tr><tr><td style="background-color:rgb(247, 247, 247)">} </td></tr></tbody></table></div><br>Program.cs:<br><div style="overflow:auto;background-color:white;line-height:100% ! important;font-family:Courier New;font-size:11px"><table style="border-width:0px;margin:2px 0px;width:99%;border-collapse:collapse;background-color:rgb(255, 255, 255)" cellpadding=0 cellspacing=0><col style="font-family:Courier New;font-size:11px;padding-left:10px;white-space:nowrap"><tbody><tr><td><font style="font-size:11px"></font><font style="color:blue">using</font><font style="font-size:11px"> System; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">using</font><font style="font-size:11px"> System.Windows.Forms; </font></td></tr><tr><td> </td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">namespace</font><font style="font-size:11px"> Test_WCF </font></td></tr><tr><td>{ </td></tr><tr><td style="background-color:rgb(247, 247, 247)">    <font style="color:blue">static</font><font style="font-size:11px"> </font><font style="color:blue">class</font><font style="font-size:11px"> Program </font></td></tr><tr><td>    { </td></tr><tr><td style="background-color:rgb(247, 247, 247)">        [STAThread] </td></tr><tr><td>        <font style="color:blue">static</font><font style="font-size:11px"> </font><font style="color:blue">void</font><font style="font-size:11px"> Main() </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        { </td></tr><tr><td>            ServiceReference1.Service1Client client = <font style="color:blue">new</font><font style="font-size:11px"> Test_WCF.ServiceReference1.Service1Client(); </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">            <font style="color:blue">try</font><font style="font-size:11px"> </font></td></tr><tr><td>            { </td></tr><tr><td style="background-color:rgb(247, 247, 247)">                MessageBox.Show(client.GetData(12).ToString()); </td></tr><tr><td>            } </td></tr><tr><td style="background-color:rgb(247, 247, 247)">            <font style="color:blue">catch</font><font style="font-size:11px"> (Exception ex) </font></td></tr><tr><td>            { </td></tr><tr><td style="background-color:rgb(247, 247, 247)">                MessageBox.Show(ex.Message); </td></tr><tr><td>            } </td></tr><tr><td style="background-color:rgb(247, 247, 247)">        } </td></tr><tr><td>    } </td></tr><tr><td style="background-color:rgb(247, 247, 247)">} </td></tr><tr><td> </td></tr></tbody></table></div><br> © 2009 Microsoft Corporation. All rights reserved.Wed, 11 Feb 2009 18:46:28 Z123f0d20-a018-48b0-ab92-4aae749f2d5ehttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#123f0d20-a018-48b0-ab92-4aae749f2d5ehttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#123f0d20-a018-48b0-ab92-4aae749f2d5eChris Dahlberghttp://social.msdn.microsoft.com/Profile/en-US/?user=Chris%20DahlbergGetting "(400) Bad Request" exception on VS Development Server in Windows 7I have a bare-bones WCF service and client that fail when using the Visual Studio Development Server in Windows 7. I get the following exception:<br><br><div style="overflow:auto;background-color:white;line-height:100% ! important;font-family:Courier New;font-size:11px"><table style="border-width:0px;margin:2px 0px;width:99%;border-collapse:collapse;background-color:rgb(255, 255, 255)" cellpadding=0 cellspacing=0><col style="font-family:Courier New;font-size:11px;padding-left:10px;white-space:nowrap"><tbody><tr><td><font style="font-size:11px">The remote server returned an error: (400) Bad Request. </font></td></tr></tbody></table></div><br><br>The inner exception from tracing:<br><div style="overflow:auto;background-color:white;line-height:100% ! important;font-family:Courier New;font-size:11px"><table style="border-width:0px;margin:2px 0px;width:99%;border-collapse:collapse;background-color:rgb(255, 255, 255)" cellpadding=0 cellspacing=0><col style="font-family:Courier New;font-size:11px;padding-left:10px;white-space:nowrap"><tbody><tr><td><font style="font-size:11px"></font><font style="color:blue">&lt;</font><font style="font-size:11px">InnerException</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">    &lt;</font><font style="font-size:11px">ExceptionType</font><font style="color:blue">&gt;</font><font style="font-size:11px">System.Xml.XmlException, System.Xml, </font><font style="color:red">Version</font><font style="font-size:11px">=</font><font style="color:blue">2</font><font style="font-size:11px">.0.0.0, </font><font style="color:red">Culture</font><font style="font-size:11px">=</font><font style="color:blue">neutral</font><font style="font-size:11px">, </font><font style="color:red">PublicKeyToken</font><font style="font-size:11px">=</font><font style="color:blue">b77a5c561934e089</font><font style="font-size:11px">&lt;/</font><font style="color:black;font-weight:bold">ExceptionType</font><font style="font-size:11px">&gt; </font></td></tr><tr><td><font style="color:blue">    &lt;</font><font style="font-size:11px">Message</font><font style="color:blue">&gt;</font><font style="font-size:11px">The body of the message cannot be read because it is empty.</font><font style="color:blue">&lt;/</font><font style="font-size:11px">Message</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">    &lt;</font><font style="font-size:11px">StackTrace</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>at System.ServiceModel.Channels.HttpRequestContext.CreateMessage() </td></tr><tr><td style="background-color:rgb(247, 247, 247)">at System.ServiceModel.Channels.HttpChannelListener.HttpContextReceived(HttpRequestContext context, ItemDequeuedCallback callback) </td></tr><tr><td>at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result) </td></tr><tr><td style="background-color:rgb(247, 247, 247)">at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() </td></tr><tr><td>at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() </td></tr><tr><td style="background-color:rgb(247, 247, 247)">at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state) </td></tr><tr><td>at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke2() </td></tr><tr><td style="background-color:rgb(247, 247, 247)">at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke() </td></tr><tr><td>at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ProcessCallbacks() </td></tr><tr><td style="background-color:rgb(247, 247, 247)">at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.CompletionCallback(Object state) </td></tr><tr><td>at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) </td></tr><tr><td style="background-color:rgb(247, 247, 247)">at System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) </td></tr><tr><td>at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) </td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">    &lt;/</font><font style="font-size:11px">StackTrace</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td><font style="color:blue">    &lt;</font><font style="font-size:11px">ExceptionString</font><font style="color:blue">&gt;</font><font style="font-size:11px">System.Xml.XmlException: The body of the message cannot be read because it is empty.</font><font style="color:blue">&lt;/</font><font style="font-size:11px">ExceptionString</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">&lt;/</font><font style="font-size:11px">InnerException</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr></tbody></table></div><br><br><br>The identical code works fine when using the Visual Studio Development Server in Vista, or IIS7 in either Vista or Windows 7. Any ideas?<br><br>IService1.cs:<br><div style="overflow:auto;background-color:white;line-height:100% ! important;font-family:Courier New;font-size:11px"><table style="border-width:0px;margin:2px 0px;width:99%;border-collapse:collapse;background-color:rgb(255, 255, 255)" cellpadding=0 cellspacing=0><col style="font-family:Courier New;font-size:11px;padding-left:10px;white-space:nowrap"><tbody><tr><td><font style="font-size:11px"></font><font style="color:blue">using</font><font style="font-size:11px"> System.ServiceModel; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"> </td></tr><tr><td><font style="color:blue">namespace</font><font style="font-size:11px"> TestService </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">{ </td></tr><tr><td>    [ServiceContract] </td></tr><tr><td style="background-color:rgb(247, 247, 247)">    <font style="color:blue">public</font><font style="font-size:11px"> </font><font style="color:blue">interface</font><font style="font-size:11px"> IService1 </font></td></tr><tr><td>    { </td></tr><tr><td style="background-color:rgb(247, 247, 247)">        [OperationContract] </td></tr><tr><td>        <font style="color:blue">string</font><font style="font-size:11px"> GetData(</font><font style="color:blue">int</font><font style="font-size:11px"> value); </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">    } </td></tr><tr><td>} </td></tr><tr><td style="background-color:rgb(247, 247, 247)"> </td></tr></tbody></table></div><br>Service1.svc.cs:<br><div style="overflow:auto;background-color:white;line-height:100% ! important;font-family:Courier New;font-size:11px"><table style="border-width:0px;margin:2px 0px;width:99%;border-collapse:collapse;background-color:rgb(255, 255, 255)" cellpadding=0 cellspacing=0><col style="font-family:Courier New;font-size:11px;padding-left:10px;white-space:nowrap"><tbody><tr><td><font style="font-size:11px"></font><font style="color:blue">namespace</font><font style="font-size:11px"> TestService </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">{ </td></tr><tr><td>    <font style="color:blue">public</font><font style="font-size:11px"> </font><font style="color:blue">class</font><font style="font-size:11px"> Service1 : IService1 </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">    { </td></tr><tr><td>        <font style="color:blue">public</font><font style="font-size:11px"> </font><font style="color:blue">string</font><font style="font-size:11px"> GetData(</font><font style="color:blue">int</font><font style="font-size:11px"> value) </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        { </td></tr><tr><td>            <font style="color:blue">return</font><font style="font-size:11px"> </font><font style="color:blue">string</font><font style="font-size:11px">.Format(</font><font style="color:blue">&quot;You entered: {0}&quot;</font><font style="font-size:11px">, value); </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        } </td></tr><tr><td>    } </td></tr><tr><td style="background-color:rgb(247, 247, 247)">} </td></tr></tbody></table></div><br>Program.cs:<br><div style="overflow:auto;background-color:white;line-height:100% ! important;font-family:Courier New;font-size:11px"><table style="border-width:0px;margin:2px 0px;width:99%;border-collapse:collapse;background-color:rgb(255, 255, 255)" cellpadding=0 cellspacing=0><col style="font-family:Courier New;font-size:11px;padding-left:10px;white-space:nowrap"><tbody><tr><td><font style="font-size:11px"></font><font style="color:blue">using</font><font style="font-size:11px"> System; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">using</font><font style="font-size:11px"> System.Windows.Forms; </font></td></tr><tr><td> </td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">namespace</font><font style="font-size:11px"> Test_WCF </font></td></tr><tr><td>{ </td></tr><tr><td style="background-color:rgb(247, 247, 247)">    <font style="color:blue">static</font><font style="font-size:11px"> </font><font style="color:blue">class</font><font style="font-size:11px"> Program </font></td></tr><tr><td>    { </td></tr><tr><td style="background-color:rgb(247, 247, 247)">        [STAThread] </td></tr><tr><td>        <font style="color:blue">static</font><font style="font-size:11px"> </font><font style="color:blue">void</font><font style="font-size:11px"> Main() </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        { </td></tr><tr><td>            ServiceReference1.Service1Client client = <font style="color:blue">new</font><font style="font-size:11px"> Test_WCF.ServiceReference1.Service1Client(); </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">            <font style="color:blue">try</font><font style="font-size:11px"> </font></td></tr><tr><td>            { </td></tr><tr><td style="background-color:rgb(247, 247, 247)">                MessageBox.Show(client.GetData(12).ToString()); </td></tr><tr><td>            } </td></tr><tr><td style="background-color:rgb(247, 247, 247)">            <font style="color:blue">catch</font><font style="font-size:11px"> (Exception ex) </font></td></tr><tr><td>            { </td></tr><tr><td style="background-color:rgb(247, 247, 247)">                MessageBox.Show(ex.Message); </td></tr><tr><td>            } </td></tr><tr><td style="background-color:rgb(247, 247, 247)">        } </td></tr><tr><td>    } </td></tr><tr><td style="background-color:rgb(247, 247, 247)">} </td></tr><tr><td> </td></tr></tbody></table></div><br> Mon, 12 Jan 2009 22:35:17 Z2009-01-12T22:35:17Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#72a0b1cb-2d0d-4647-ba57-646f3b949ee5http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#72a0b1cb-2d0d-4647-ba57-646f3b949ee5Chris Dahlberghttp://social.msdn.microsoft.com/Profile/en-US/?user=Chris%20DahlbergGetting "(400) Bad Request" exception on VS Development Server in Windows 7So far I've tried with all of the IIS7 / WAS features installed, none of the IIS7 / WAS features installed, running VS2008 normally and as admin, with Windows Firewall enabled and disabled, and at all levels of UAC. No changes.<br><br>I'd like to use Windows 7 more, but since i'm currently working on a WCF service it's rather difficult when WCF services don't work properly.<br>Wed, 14 Jan 2009 14:50:28 Z2009-01-14T14:50:28Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#d9308314-07fb-425a-84ab-9e54934041f8http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#d9308314-07fb-425a-84ab-9e54934041f8Olmohttp://social.msdn.microsoft.com/Profile/en-US/?user=OlmoGetting "(400) Bad Request" exception on VS Development Server in Windows 7<p>Same problem here, Development Server returns the exact same error on my new Windows 7 on two different WCF services. I'm going to try with IIS now.<br><br>Congrats for Windows 7 anyway :) </p>Mon, 19 Jan 2009 14:35:50 Z2009-01-19T14:35:50Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#0971ede1-e24e-4034-9c7a-98271af3e1b0http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#0971ede1-e24e-4034-9c7a-98271af3e1b0Vinela Pothinenihttp://social.msdn.microsoft.com/Profile/en-US/?user=Vinela%20PothineniGetting "(400) Bad Request" exception on VS Development Server in Windows 7 Could you provide the client/server config? Tue, 20 Jan 2009 20:33:56 Z2009-01-20T20:33:56Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#4a701963-3836-46dc-a602-8b7163565298http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#4a701963-3836-46dc-a602-8b7163565298Chris Dahlberghttp://social.msdn.microsoft.com/Profile/en-US/?user=Chris%20DahlbergGetting "(400) Bad Request" exception on VS Development Server in Windows 7Client:<br> <div style="overflow:auto;background-color:white;line-height:100% ! important;font-family:courier new;font-size:11px"> <table style="border-width:0px;margin:2px 0px;width:99%;border-collapse:collapse;background-color:rgb(255, 255, 255)" cellpadding=0 cellspacing=0> <col style="font-family:courier new;font-size:11px;padding-left:10px;white-space:nowrap"> <tbody> <tr> <td><font style="font-size:11px">    </font><font style="color:blue">&lt;</font><font style="font-size:11px">system.serviceModel</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;</font><font style="font-size:11px">bindings</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td>            <font style="color:blue">&lt;</font><font style="font-size:11px">wsHttpBinding</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td style="background-color:rgb(247, 247, 247)">                <font style="color:blue">&lt;</font><font style="font-size:11px">binding </font><font style="color:red">name</font><font style="font-size:11px">=</font><font style="color:blue">&quot;WSHttpBinding_IService1&quot;</font><font style="font-size:11px"> </font><font style="color:red">closeTimeout</font><font style="font-size:11px">=</font><font style="color:blue">&quot;00:01:00&quot;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td>                    <font style="color:red">openTimeout</font><font style="font-size:11px">=</font><font style="color:blue">&quot;00:01:00&quot;</font><font style="font-size:11px"> </font><font style="color:red">receiveTimeout</font><font style="font-size:11px">=</font><font style="color:blue">&quot;00:10:00&quot;</font><font style="font-size:11px"> </font><font style="color:red">sendTimeout</font><font style="font-size:11px">=</font><font style="color:blue">&quot;00:01:00&quot;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td style="background-color:rgb(247, 247, 247)">                    <font style="color:red">bypassProxyOnLocal</font><font style="font-size:11px">=</font><font style="color:blue">&quot;false&quot;</font><font style="font-size:11px"> </font><font style="color:red">transactionFlow</font><font style="font-size:11px">=</font><font style="color:blue">&quot;false&quot;</font><font style="font-size:11px"> </font><font style="color:red">hostNameComparisonMode</font><font style="font-size:11px">=</font><font style="color:blue">&quot;StrongWildcard&quot;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td>                    <font style="color:red">maxBufferPoolSize</font><font style="font-size:11px">=</font><font style="color:blue">&quot;524288&quot;</font><font style="font-size:11px"> </font><font style="color:red">maxReceivedMessageSize</font><font style="font-size:11px">=</font><font style="color:blue">&quot;65536&quot;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td style="background-color:rgb(247, 247, 247)">                    <font style="color:red">messageEncoding</font><font style="font-size:11px">=</font><font style="color:blue">&quot;Text&quot;</font><font style="font-size:11px"> </font><font style="color:red">textEncoding</font><font style="font-size:11px">=</font><font style="color:blue">&quot;utf-8&quot;</font><font style="font-size:11px"> </font><font style="color:red">useDefaultWebProxy</font><font style="font-size:11px">=</font><font style="color:blue">&quot;true&quot;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td>                    <font style="color:red">allowCookies</font><font style="font-size:11px">=</font><font style="color:blue">&quot;false&quot;</font><font style="font-size:11px">&gt; </font></td> </tr> <tr> <td style="background-color:rgb(247, 247, 247)">                    <font style="color:blue">&lt;</font><font style="font-size:11px">readerQuotas </font><font style="color:red">maxDepth</font><font style="font-size:11px">=</font><font style="color:blue">&quot;32&quot;</font><font style="font-size:11px"> </font><font style="color:red">maxStringContentLength</font><font style="font-size:11px">=</font><font style="color:blue">&quot;8192&quot;</font><font style="font-size:11px"> </font><font style="color:red">maxArrayLength</font><font style="font-size:11px">=</font><font style="color:blue">&quot;16384&quot;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td>                        <font style="color:red">maxBytesPerRead</font><font style="font-size:11px">=</font><font style="color:blue">&quot;4096&quot;</font><font style="font-size:11px"> </font><font style="color:red">maxNameTableCharCount</font><font style="font-size:11px">=</font><font style="color:blue">&quot;16384&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td style="background-color:rgb(247, 247, 247)">                    <font style="color:blue">&lt;</font><font style="font-size:11px">reliableSession </font><font style="color:red">ordered</font><font style="font-size:11px">=</font><font style="color:blue">&quot;true&quot;</font><font style="font-size:11px"> </font><font style="color:red">inactivityTimeout</font><font style="font-size:11px">=</font><font style="color:blue">&quot;00:10:00&quot;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td>                        <font style="color:red">enabled</font><font style="font-size:11px">=</font><font style="color:blue">&quot;false&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td style="background-color:rgb(247, 247, 247)">                    <font style="color:blue">&lt;</font><font style="font-size:11px">security </font><font style="color:red">mode</font><font style="font-size:11px">=</font><font style="color:blue">&quot;Message&quot;</font><font style="font-size:11px">&gt; </font></td> </tr> <tr> <td>                        <font style="color:blue">&lt;</font><font style="font-size:11px">transport </font><font style="color:red">clientCredentialType</font><font style="font-size:11px">=</font><font style="color:blue">&quot;Windows&quot;</font><font style="font-size:11px"> </font><font style="color:red">proxyCredentialType</font><font style="font-size:11px">=</font><font style="color:blue">&quot;None&quot;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td style="background-color:rgb(247, 247, 247)">                            <font style="color:red">realm</font><font style="font-size:11px">=</font><font style="color:blue">&quot;&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td>                        <font style="color:blue">&lt;</font><font style="font-size:11px">message </font><font style="color:red">clientCredentialType</font><font style="font-size:11px">=</font><font style="color:blue">&quot;Windows&quot;</font><font style="font-size:11px"> </font><font style="color:red">negotiateServiceCredential</font><font style="font-size:11px">=</font><font style="color:blue">&quot;true&quot;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td style="background-color:rgb(247, 247, 247)">                            <font style="color:red">algorithmSuite</font><font style="font-size:11px">=</font><font style="color:blue">&quot;Default&quot;</font><font style="font-size:11px"> </font><font style="color:red">establishSecurityContext</font><font style="font-size:11px">=</font><font style="color:blue">&quot;true&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td>                    <font style="color:blue">&lt;/</font><font style="font-size:11px">security</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td style="background-color:rgb(247, 247, 247)">                <font style="color:blue">&lt;/</font><font style="font-size:11px">binding</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td>            <font style="color:blue">&lt;/</font><font style="font-size:11px">wsHttpBinding</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;/</font><font style="font-size:11px">bindings</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td>        <font style="color:blue">&lt;</font><font style="font-size:11px">client</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td style="background-color:rgb(247, 247, 247)">            <font style="color:blue">&lt;</font><font style="font-size:11px">endpoint </font><font style="color:red">address</font><font style="font-size:11px">=</font><font style="color:blue">&quot;http://localhost:49465/Service1.svc&quot;</font><font style="font-size:11px"> </font><font style="color:red">binding</font><font style="font-size:11px">=</font><font style="color:blue">&quot;wsHttpBinding&quot;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td>                <font style="color:red">bindingConfiguration</font><font style="font-size:11px">=</font><font style="color:blue">&quot;WSHttpBinding_IService1&quot;</font><font style="font-size:11px"> </font><font style="color:red">contract</font><font style="font-size:11px">=</font><font style="color:blue">&quot;ServiceReference1.IService1&quot;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td style="background-color:rgb(247, 247, 247)">                <font style="color:red">name</font><font style="font-size:11px">=</font><font style="color:blue">&quot;WSHttpBinding_IService1&quot;</font><font style="font-size:11px">&gt; </font></td> </tr> <tr> <td>            <font style="color:blue">&lt;/</font><font style="font-size:11px">endpoint</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;/</font><font style="font-size:11px">client</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td> </tr> <tr> <td>    <font style="color:blue">&lt;/</font><font style="font-size:11px">system.serviceModel</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td> </tr> </tbody> </table> </div> <br> Server:<br><div style="overflow:auto;background-color:white;line-height:100% ! important;font-family:Courier New;font-size:11px"><table style="border-width:0px;margin:2px 0px;width:99%;border-collapse:collapse;background-color:rgb(255, 255, 255)" cellpadding=0 cellspacing=0><col style="font-family:Courier New;font-size:11px;padding-left:10px;white-space:nowrap"><tbody><tr><td><font style="font-size:11px">    </font><font style="color:blue">&lt;</font><font style="font-size:11px">system.serviceModel</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;</font><font style="font-size:11px">services</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td> </td></tr><tr><td style="background-color:rgb(247, 247, 247)">            <font style="color:blue">&lt;</font><font style="font-size:11px">service </font><font style="color:red">name</font><font style="font-size:11px">=</font><font style="color:blue">&quot;TestService.Service1&quot;</font><font style="font-size:11px"> </font><font style="color:red">behaviorConfiguration</font><font style="font-size:11px">=</font><font style="color:blue">&quot;TestService.Service1Behavior&quot;</font><font style="font-size:11px">&gt; </font></td></tr><tr><td>                <font style="color:green">&lt;!-- Service Endpoints --&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"> </td></tr><tr><td>                <font style="color:blue">&lt;</font><font style="font-size:11px">endpoint </font><font style="color:red">address</font><font style="font-size:11px">=</font><font style="color:blue">&quot;&quot;</font><font style="font-size:11px"> </font><font style="color:red">binding</font><font style="font-size:11px">=</font><font style="color:blue">&quot;wsHttpBinding&quot;</font><font style="font-size:11px"> </font><font style="color:red">contract</font><font style="font-size:11px">=</font><font style="color:blue">&quot;TestService.IService1&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">                <font style="color:blue">&lt;</font><font style="font-size:11px">endpoint </font><font style="color:red">address</font><font style="font-size:11px">=</font><font style="color:blue">&quot;mex&quot;</font><font style="font-size:11px"> </font><font style="color:red">binding</font><font style="font-size:11px">=</font><font style="color:blue">&quot;mexHttpBinding&quot;</font><font style="font-size:11px"> </font><font style="color:red">contract</font><font style="font-size:11px">=</font><font style="color:blue">&quot;IMetadataExchange&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>            <font style="color:blue">&lt;/</font><font style="font-size:11px">service</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;/</font><font style="font-size:11px">services</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>        <font style="color:blue">&lt;</font><font style="font-size:11px">behaviors</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">            <font style="color:blue">&lt;</font><font style="font-size:11px">serviceBehaviors</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>                <font style="color:blue">&lt;</font><font style="font-size:11px">behavior </font><font style="color:red">name</font><font style="font-size:11px">=</font><font style="color:blue">&quot;TestService.Service1Behavior&quot;</font><font style="font-size:11px">&gt; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">                    <font style="color:green">&lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>                    <font style="color:blue">&lt;</font><font style="font-size:11px">serviceMetadata </font><font style="color:red">httpGetEnabled</font><font style="font-size:11px">=</font><font style="color:blue">&quot;true&quot;</font><font style="font-size:11px">/&gt; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">                    <font style="color:green">&lt;!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information --&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>                    <font style="color:blue">&lt;</font><font style="font-size:11px">serviceDebug </font><font style="color:red">includeExceptionDetailInFaults</font><font style="font-size:11px">=</font><font style="color:blue">&quot;true&quot;</font><font style="font-size:11px">/&gt; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">                <font style="color:blue">&lt;/</font><font style="font-size:11px">behavior</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>            <font style="color:blue">&lt;/</font><font style="font-size:11px">serviceBehaviors</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;/</font><font style="font-size:11px">behaviors</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>    <font style="color:blue">&lt;/</font><font style="font-size:11px">system.serviceModel</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr></tbody></table></div><br> Tue, 20 Jan 2009 21:13:27 Z2009-01-20T21:13:27Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#89178bde-4ca3-41dd-9158-e28ca9550267http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#89178bde-4ca3-41dd-9158-e28ca9550267Vinela Pothinenihttp://social.msdn.microsoft.com/Profile/en-US/?user=Vinela%20PothineniGetting "(400) Bad Request" exception on VS Development Server in Windows 7Hi Chris,<br><br>Can you try using a non-secure binding like basicHttpBinding and see if you run into the same issue ? Looks like a security issue.<br><br>Thanks,<br>Vinela<br><br>Wed, 21 Jan 2009 01:39:50 Z2009-01-21T01:39:50Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#b2779193-2bcb-4b38-b34f-3f7fb079553bhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#b2779193-2bcb-4b38-b34f-3f7fb079553bChris Dahlberghttp://social.msdn.microsoft.com/Profile/en-US/?user=Chris%20DahlbergGetting "(400) Bad Request" exception on VS Development Server in Windows 7It did work after switching to basicHttpBinding. Any ideas on how to get wsHttpBinding working, now? Wed, 21 Jan 2009 03:31:15 Z2009-01-21T03:31:15Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#429370fa-dc2e-4daf-8baf-ea45f98dda80http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#429370fa-dc2e-4daf-8baf-ea45f98dda80Dan Glick - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Dan%20Glick%20-%20MSFTGetting "(400) Bad Request" exception on VS Development Server in Windows 7 Just wanted to let you know that we've repro'ed the issue on our side, and will be investigating further. Thanks a lot for reporting this; we'll follow up when we have more concrete information.Thu, 22 Jan 2009 20:01:24 Z2009-01-22T20:01:24Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#5516a516-5426-4364-84ed-766eae51dd3chttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/123f0d20-a018-48b0-ab92-4aae749f2d5e#5516a516-5426-4364-84ed-766eae51dd3cDan Glick - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Dan%20Glick%20-%20MSFTGetting "(400) Bad Request" exception on VS Development Server in Windows 7Update: You should see this fixed in the next release of Win7. Thanks again for your reports.Wed, 11 Feb 2009 18:46:12 Z2009-02-11T18:46:12Z