JSON文字列エンティティを受け入れるWCFサービスがあり、これがメソッドです:
更新:これはWCFサービスに関連していないため、問題を解決しましたが、「ù」のような特殊文字をフォーマットしておらず、サーバーがこの文字の受け入れを拒否しているため、使用しているGSONフォーマットに関連しています。
<WebInvoke(UriTemplate:="UpdateUser", ResponseFormat:=WebMessageFormat.Json, RequestFormat:=WebMessageFormat.Json, Method:="POST", BodyStyle:=WebMessageBodyStyle.WrappedRequest)> _
Public Function UpdateUser(user As String) As Stream Implements IService1.UpdateUser
End Function
以下のコードと短い JSON 文字列を含む JSON 文字列を JAVA HttpClient 経由で投稿しようとすると、すべて正常に動作しますが、JSON 文字列のサイズが大きい場合、IIS 7.5 の応答は次のようになります。
-MODULE_SET_RESPONSE_ERROR_STATUS ModuleName ManagedPipelineHandler 通知 128 HttpStatus 400 HttpReason Bad Request HttpSubStatus 0 ErrorCode 0 ConfigExceptionInfo 通知 EXECUTE_REQUEST_HANDLER ErrorCode 操作完了。(0x0)
Web.Config で MaxReceivedMessageSize およびその他のサイズ設定を既に試しましたが、成功しませんでした。
これは私の Web.Config ファイルです
<services>
<service name="WBVoice4Facebook.Service1" behaviorConfiguration="ServiceBehaviour">
<endpoint address="" binding="webHttpBinding" bindingConfiguration="StreamedRequestWebBinding" contract="WBVoice4Facebook.IService1" behaviorConfiguration="web">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviour">
<dataContractSerializer maxItemsInObjectGraph="2147483646"/>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<dataContractSerializer maxItemsInObjectGraph="2147483646" />
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<netMsmqBinding>
<binding name="NewBinding0">
<security>
<transport msmqAuthenticationMode="None" msmqProtectionLevel="None" />
</security>
</binding>
</netMsmqBinding>
<webHttpBinding>
<binding name="StreamedRequestWebBinding"
openTimeout="10:15:00"
receiveTimeout="10:15:00"
sendTimeout="10:15:00"
bypassProxyOnLocal="true"
hostNameComparisonMode="WeakWildcard"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
transferMode="Streamed"
useDefaultWebProxy="false">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="InheritedFromHost" />
</security>
</binding>
</webHttpBinding>
</bindings>