Hi,
I have a WCF Web Service Running on my IIS. It takes data from client and inserts in the Database. My Web Service requies an object of complex Data type Players. In the Client I create an object of Players and pass it to the Web Service to do the Work.
In my client console app i am doing
string strBaseAddress = ConfigurationSettings.AppSettings["WEBSERVICE"];
Uri baseAddress = new Uri(strBaseAddress);
WebServiceHost host = new WebServiceHost(typeof(TrialCenterAPI), baseAddress);
host.open
// Doing Work
host.close
This App is working fine.
Now when I wrote another client by adding a service reference to do the same work. It gives me the 400 Bad Request Error every time.
I created object of the API Client which was generated automatically, then called the appropriate method of web service and passed the object of Players to it. I tried googling and i didn't get any solution., I increased the Max size in Server as well as Client Web Config.
The client Web Config uses Custom Binding as follows:
<system.serviceModel>
<bindings>
<customBinding>
<binding name="WebHttpBinding">
<textMessageEncoding
maxReadPoolSize="2147483647"
maxWritePoolSize="2147483647"
messageVersion="None" writeEncoding="utf-8" >
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</textMessageEncoding>
<httpTransport
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"/>
</binding>
</customBinding>
</bindings>
<client>
<endpoint name="WebHttpBinding"
address="Service Address/"
binding="customBinding"
bindingConfiguration="WebHttpBinding"
contract="TestClientAPI.API" />
</client>
</system.serviceModel>
Any help will be highly appreciated