나는이 오류를 일주일 동안 사용해 왔지만 검색 한 후에도이를 해결할 수 없습니다. 오류이다Set MaxReceivedMessageSize (원격 서버에서 예기치 않은 응답을 보냈습니다 : (400) Bad Request.) web.config가 작동하지 않습니다.
원격 서버에서 예기치 않은 응답을 반환 (400) 나쁜 요청.
Windows 전화 앱에서 WCF를 통해 이미지를 저장하려고합니다. 기본값보다 높은 MaxReceivedMessageSize
을 설정해야합니다. 나는 운을 제외한 모든 것을 시도했다!
내 web.config
파일 (WCF 서비스) 내 Windows 전화 응용 프로그램에
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService1"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
hostNameComparisonMode="StrongWildcard"
receiveTimeout="00:10:10"
sendTimeout="00:10:00"
openTimeout="00:10:00"
closeTimeout="00:10:00"
transferMode="Buffered"
messageEncoding="Text"
textEncoding="utf-8"
bypassProxyOnLocal="false"
useDefaultWebProxy="true" >
<readerQuotas
maxDepth="2147483647"
maxStringContentLength="2147483646"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="Service1" behaviorConfiguration="Service1Behavior">
<endpoint
address=""
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IService1"
contract="IService1" />
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange"
/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Service1Behavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
</configuration>
에만있는 ServiceReferences.ClientConfig
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService1" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:1772/Service1.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IService1"
contract="ServiceReference1.IService1"
name="BasicHttpBinding_IService1" />
</client>
</system.serviceModel>
</configuration>
나는 또한 코드에서 바인딩을 설정하려고 :
BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = 2147483647;
binding.MaxBufferSize = 2147483647;
EndpointAddress endpointAddress = new EndpointAddress("http://localhost:1772/Service1.svc");
Service1Client proxy = new Service1Client(binding, endpointAddress);
을
나는 이것을 고치는 법을 정말로 모른다. .. 그것은 서버 d와 같이 보인다. 내 web.config 파일을 idn't 사용 ??? 이 경우 어떻게 업데이트합니까?
작은 이미지 (65kb 미만)를 업로드 할 수 있습니다. –
많은 할당량 설정이 있습니다. 서버 추적 기능을 켜면 정확히 어느 것이 옳은지 알 수 있습니다. –