Click here to Skip to main content
14,732,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I was getting exception while making a call the my WCF service more larger request xml object content length 65708, where it is working without any issues with request xml file content length less than this. This is service we are exposed to external clients and I used SoapUI to debug the service and I am getting the exception HTTP/1.1 400 Bad Request[\r][\n] and not even hitting to the debug point. I goggled a lot and applied the configuration values provided, but none of them helped me to resolve the issue.

After all the config changes, my web.config file is looks like this (only binding part).
<bindings>
      <basichttpbinding>
        <binding name="GDASHttp" closetimeout="00:10:00" opentimeout="00:10:00" receivetimeout="00:10:00" sendtimeout="00:10:00" bypassproxyonlocal="false" hostnamecomparisonmode="StrongWildcard" maxbuffersize="2147483647" maxbufferpoolsize="2147483647" maxreceivedmessagesize="2147483647" messageencoding="Mtom" textencoding="utf-8" transfermode="Streamed" usedefaultwebproxy="true">
          <readerquotas maxdepth="2147483647" maxstringcontentlength="2147483647" maxarraylength="2147483647" maxbytesperread="2147483647" maxnametablecharcount="2147483647" />
          <security mode="TransportCredentialOnly">
            <transport clientcredentialtype="Windows" />
          </security>
        </binding>
</basichttpbinding>


I didn't changed any settings in the client file as I can getting the exception from SoapUI and issue is related to server configuration only. I do understand the issue with some the settings is accepting according to the file size, but not sure what is maximum values we can provide in the above settings.

I modified the IIS settings as per some of the Google advises in the server and this is my changed applicationhost.config file.

<location path="Default Web Site/GDAS.FY15R2.3.1/Trusted" overridemode="Allow">
        <system.webserver>
            <handlers accesspolicy="Read, Execute" />
            <security>
                <ipsecurity>
                    <add ipaddress="127.0.0.1" subnetmask="255.255.255.255" allowed="true" />
                </ipsecurity>
                        <requestfiltering> 
                        <requestlimits maxallowedcontentlength="40000000" /> 
                        </requestfiltering> 
            </security>
            <serverruntime uploadreadaheadsize="2147483647" />
        </system.webserver>
    </location>


Is anyone can help me to resolve this issue asap as I am sitting on this issue in the last 3-4 days but none the settings is help me till now. I am greatly appreciated your helps and supports.

Thanks,
Bins
Posted
Updated 9-Sep-14 5:50am
v2

1.have you tried to access your service url from browser only ?

2. if you have tried and it is working properly then it is definately problem with your server configuration section . The most basic thing to get it work. I would suggest please check your server and client configuration section matches.
-> ReaderQuotas should be same at both the end
-> Security mechanism used at both the end should be same(ClientCredential Type in your case it is windows so my advice is please check that your client is also configured with that only)
-> Bad Request also suggest that your encoding of text at both the end is also not matching the specified criteria.please check that also.
   
Thanks Ashok.

I checked the service in the browser and it is working, but I didn't matched the client and server configuraitons because from SoapUI itself I am getting the exception and moreover the client is an external team and we may not have access to compare settings from their end.

Suppose I used the smaller xml as input param to SoapUI and Attached Process in VS for debugging, its hitting the first line of my services code. Where as it is not hitting in case of bigger xml input param to SoapUI, ie; the service itself not triggering. In that case is it true that the issue is within server itself and would it still required to verify the client configuration as well??? Please correct me If I am wrong and tell me a solution to test this.

Thanks,
Bins
   
Comments
ashok rathod 10-Sep-14 6:01am
   
first thing to test is that your required input format is not custome object. in that case you need to set it KnownTypeAttribute to Send outside your service domain. if that is the case then please check. have you decorated your method with operation contract attribute RequestFormat then make sure that format is xml

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900