Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF Error 400 Bad Request when POST some data
    primarykey
    data
    text
    <p>I have a WCF Service in my local machine that works like a "bridge" between a client application and a database in remote.</p> <p>The WCF service works with Entity Framework classes and works fine when get the data but doesn't work when post anything and i getting the next error message: "(400) Bad Request".</p> <p>This is my client code:</p> <pre><code>//Connect to WCF Service CHS_Local.ServiceFrontalClient proxy = new CHS_Local.ServiceFrontalClient(); //Get a "Client" class wich ClientID == 1 CHS_Local.Client client = proxy.GetClient(1); //Change some stuff client.Name = "change someting"; //Send the modified class to service to update the database proxy.UpdateClient(client); </code></pre> <p>This my <code>&lt;system.serviceModel&gt;</code> tag in wcf config file:</p> <pre><code>&lt;system.serviceModel&gt; &lt;services&gt; &lt;service name="CentralizedHostingService.ServiceFrontal"&gt; &lt;endpoint address="" binding="wsHttpBinding" contract="CentralizedHostingService.IServiceFrontal"&gt; &lt;identity&gt; &lt;dns value="localhost" /&gt; &lt;/identity&gt; &lt;/endpoint&gt; &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="http://localhost:8732/Design_Time_Addresses/CentralizedHostingService/Service1/" /&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior&gt; &lt;serviceMetadata httpGetEnabled="True" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="False" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;/system.serviceModel&gt; </code></pre> <p>And my <code>app.config</code> in client application:</p> <pre><code>&lt;system.serviceModel&gt; &lt;bindings&gt; &lt;wsHttpBinding&gt; &lt;binding name="WSHttpBinding_IServiceFrontal" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="5000000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"&gt; &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; &lt;reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /&gt; &lt;security mode="Message"&gt; &lt;transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /&gt; &lt;message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/wsHttpBinding&gt; &lt;/bindings&gt; &lt;client&gt; &lt;endpoint address="http://localhost:8732/Design_Time_Addresses/CentralizedHostingService/Service1/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IServiceFrontal" contract="CHS_Local.IServiceFrontal" name="WSHttpBinding_IServiceFrontal"&gt; &lt;identity&gt; &lt;dns value="localhost" /&gt; &lt;/identity&gt; &lt;/endpoint&gt; &lt;/client&gt; &lt;/system.serviceModel&gt; </code></pre> <p>Service Interface:</p> <pre><code> [OperationContract] Client GetClient(int clientID); [OperationContract] void UpdateClient(Client editedClient); </code></pre> <p>In a first instance I though that the problem resides in the weight of the petition but i see using Fiddler that bytes send for the petition are only 115.903 bytes (~0.11MB). Any idea? </p> <p>As you can see is a simple example but don't works :(</p> <p>Thanks for you help! :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload