0

Windows Phone アプリケーションから大きなバイト配列をwcf サービスに渡そうとしています。大きなバイト配列を渡すためにあらゆる方法を試しましたが、渡すことができませんでした。

これが私のweb.configです

<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <!--<binding maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" receiveTimeout="00:10:00" closeTimeout="00:10:00">
      <security mode="None" />
    </binding>-->
    <binding closeTimeout="01:30:00" 
      openTimeout="01:30:00" receiveTimeout="01:30:00" sendTimeout="01:30:00" transferMode="Streamed"
      maxBufferSize="2147483646" maxBufferPoolSize="2147483646" maxReceivedMessageSize="4294967295">
      <readerQuotas maxDepth="2147483646" maxStringContentLength="2147483646" maxArrayLength="2147483646"
        maxBytesPerRead="2147483646" maxNameTableCharCount="2147483646" /> 
      <security mode="None">             
      </security>
    </binding>    
  </basicHttpBinding>    
</bindings>   

<behaviors>
  <serviceBehaviors>
    <behavior>
      <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<protocolMapping>
    <add binding="basicHttpsBinding"  scheme="https"/>
</protocolMapping>    
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />

受信メッセージの最大サイズを使用しました2147483646。今、私は私の

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://xxx.xx.x.xxx/WebService/Service1.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
    contract="MyService.IService1" name="BasicHttpBinding_IService1" />
</client>
</system.serviceModel>
</configuration>

次のパラメーターを wcf サービスメソッドに渡しています

Service1.svc.cs

public string GetDataUsingDataContract(byte[] fileByte,string fileName,string folderName)
{
}

私はたくさん検索しましたが、同様の例を1つ見つけました最大配列長クォータ

しかし、windows phone 8 はサポートしていないと聞きましたnetTcpBinding2GBのファイルを wcf サービスに渡すことができると読みました。最大バイト配列を渡すにはどうすればよいですか? 私はこの問題に悩まされています。誰かがこれを解決するのを手伝ってくれますか?

4

1 に答える 1

0

これは非常に一般的な例外です。msdn social の次の投稿をご覧ください。

どちらも、Windows 8 Phone エミュレーターの問題を示しているようです。これを回避する方法については、http: //countofmontecito.com/2012/11/13/wcf-and-windows-phone-8/を参照してください。

完全なドキュメントはこちら: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj684580(v=vs.105).aspx

于 2013-09-26T09:16:42.130 に答える