silverlight   发布时间:2022-05-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了silverlight – 发送大字节数组时出错大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

我有WCF服务,通过它我在DB中添加数据.它工作正常,但当我尝试发送大字节[]时,它返回“远程服务器返回错误:NotFound”. web.config中 <?xml version="1.0"?> <configuration> <connectionStrings> <add name="JabsBaseConnectionString" connectionString="Dat
@H_450_15@
我有WCF服务,通过它我在DB中添加数据.它工作正常,但当我尝试发送大字节[]时,它返回“远程服务器返回错误:NotFound”.

web.config

<?xml version="1.0"?>
<configuration>
  <connectionStrings>
    <add name="JabsBaseConnectionString" connectionString="Data source=TAHASAGHIR-PC\sqlEXPRESS;Initial Catalog=JabsBase;Integrated Security=True" providerName="System.Data.sqlClient"/>
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Data.Linq,Version=4.0.0.0,Culture=neutral,PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
    <httpRuntime maxrequestLength="2097151" useFullyQualifiedRedirectUrl="true"/>
  </system.web>
  <system.serviceModel>    
    <serviceHosTingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true" />
    <bindings>
      <basichttpBinding>
        <binding name="SendLargeChat"
                 allowCookies="false"
                 bypassProxyOnLocal="false" 
                 maxBufferPoolSize="2147483647"
                 maxReceivedmessageSize="2147483647"
                 maxBufferSize="2147483647"
                 closeTimeout="10:00:00"
                 openTimeout="10:00:00"
                 receiveTimeout="10:00:00"
                 sendTimeout="10:00:00"
                 transferMode="Streamed">
          <readerQuotas 
            maxArrayLength="2147483647"
            maxBytesPerRead="2147483647"
            maxDepth="2147483647"
            maxNa@R_502_1979@bleCharCount="2147483647"
            maxStringContentLength="2147483647" />
        </binding>
      </basichttpBinding>      
    </bindings>
    <services>
      <service name="Prototype.SendChatservice" behaviorConfiguration="Prototype.SendChatserviceBehavior">
        <endpoint address="" binding="basichttpBinding" bindingConfiguration="SendLargeChat" contract="Prototype.SendChatservice" />
        <endpoint address="mex" binding="mexhttpBinding" contract="I@R_502_1979@dataExchange" />
      </service>      
    </services>    
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <service@R_502_1979@data httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
        <behavior name="Prototype.SendChatserviceBehavior">
          <service@R_502_1979@data httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <dataContractserializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllrequests="true"/>
  </system.webServer>
</configuration>

serviceReferences.CLIENtConfig

<configuration>
  <system.serviceModel>
    <bindings>
      <basichttpBinding>        
        <binding name="BasichttpBinding_ISendChatservice" maxBufferSize="2147483647"
          maxReceivedmessageSize="2147483647">
          <security mode="None" />
        </binding>
      </basichttpBinding>      
    </bindings>
    <client>      
      <endpoint address="http://localhost:53756/PrototypeSite/SendChatservice.svc"
        binding="basichttpBinding" bindingConfiguration="BasichttpBinding_ISendChatservice"
        contract="SendChatservice.ISendChatservice" name="BasichttpBinding_ISendChatservice" />
    </client>
  </system.serviceModel>
</configuration>

请求
POST http://localhost:53756/PrototypeSite/SendChatService.svc http / 1.1
主持人:localhost:53756
连接:保持活力
文献:http://localhost:53756/PrototypeSite/ClientBin/Prototype.xap
内容长度:1348176
soapaction:“http://tempuri.org/ISendChatservice/addMsg”
content-type:text / xml;字符集= utf-8的
接受:/
用户代理:Mozilla / 5.0(Windows NT 6.1)AppleWebKit / 534.24(KHTML,与Gecko一样)Chrome / 11.0.696.68 Safari / 534.24
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en; q = 0.8
Accept-Charset:ISO-8859-1,utf-8; q = 0.7,*; q = 0.3

响应
http / 1.1 400错误请求
服务器:ASP.NET Development Server / 10.0.0.0
日期:2011年5月26日星期四17:48:00 GMT
X-AspNet-Version:4.0.30319
缓存控制:私有
内容长度:0
连接:关闭

解决方法

404 / Not Found是Silverlight针对所有服务器错误报告的错误.如果您想知道从服务器返回的实际错误,您可以使用类似于 Fiddler内容来查看正在发送和接收的内容,包括包含服务器返回的实际错误代码错误消息的标头.

大佬总结

以上是大佬教程为你收集整理的silverlight – 发送大字节数组时出错全部内容,希望文章能够帮你解决silverlight – 发送大字节数组时出错所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。