silverlight – 远程服务器返回错误:NotFound

silverlight – 远程服务器返回错误:NotFound,第1张

概述我有一个Silverlight应用程序,它在我的asp.net应用程序中使用WCF服务.silverlight应用程序以墨水笔划的形式保存“图纸”.这些笔划是xaml(可能有点大)的形式,我将其转换为字符串并发送到服务以将字符串保存到sql server. (基本上与此应用程序 http://msdn.microsoft.com/en-us/magazine/cc721604.aspx相同类型的东 我有一个Silverlight应用程序,它在我的asp.net应用程序中使用WCF服务.silverlight应用程序以墨水笔划的形式保存“图纸”.这些笔划是xaml(可能有点大)的形式,我将其转换为字符串并发送到服务以将字符串保存到sql server. (基本上与此应用程序 http://msdn.microsoft.com/en-us/magazine/cc721604.aspx相同类型的东西).

这有效,我可以看到我的服务方法在绘图相对较小时被击中,但如果绘图变大,我会得到这个很大的错误,并且服务方法断点永远不会被击中.似乎我正在通过一个大小阈值,但我无法弄清楚我是对的还是要改变什么来解决问题.

我已经搜索谷歌和SO没有成功,所以任何帮助将不胜感激.提前致谢.

我的服务:

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]public class DrawingService: IDrawingService{    #region IDrawingService Members    public bool SaveevalAreaDrawing(int EvalAreaID,string xmlToSave)    {        return true;    }    public bool SaveevalitemDrawing(int EvalitemID,string xmlToSave)    {        return true;    }    public string GetEvalAreaDrawing(int EvalAreaID,string xmlToSave)    {        return "you got the eval drawing!";    }    public string GetEvalitemDrawing(int EvalitemID,string xmlToSave)    {        return "you got the eval item drawing!";    }    #endregion}

我的asp.net应用程序与服务web.config

<system.serviceModel><behaviors>  <serviceBehaviors>    <behavior name="MynameSpace.Services.DrawingServiceBehavior">      <serviceMetadata httpGetEnabled="true" />      <serviceDeBUG includeExceptionDetailinFaults="false" />    </behavior>  </serviceBehaviors></behaviors><bindings>  <customBinding>    <binding name="customBinding0">      <binaryMessageEnCoding />      <httpTransport>        <extendedProtectionPolicy policyEnforcement="Never" />      </httpTransport>    </binding>  </customBinding>  <wshttpBinding>    <binding name="wsPlainBinding" maxBufferPoolSize="2147483647"      maxReceivedMessageSize="2147483647">      <security mode="None">        <transport clIEntCredentialType="None">          <extendedProtectionPolicy policyEnforcement="Never" />        </transport>        <message clIEntCredentialType="None" negotiateServiceCredential="false"          establishSecurityContext="false" />      </security>    </binding>  </wshttpBinding></bindings><serviceHostingEnvironment aspNetCompatibilityEnabled="true" /><services>  <service behaviorConfiguration="HSD.ECERS.Services.DrawingServiceBehavior"    name="HSD.ECERS.Services.DrawingService">    <endpoint address="Services" binding="wshttpBinding" bindingConfiguration="wsPlainBinding"      name="wsPlainhttp" contract="HSD.ECERS.Services.IDrawingService" />    <endpoint address="mex" binding="mexhttpBinding" name="wsdl"      contract="IMetadataExchange" />  </service></services>

ServiceReferences.ClIEntConfig

<configuration><system.serviceModel>    <bindings>        <customBinding>            <binding name="wsPlainhttp">                <textMessageEnCoding messageVersion="Default" writeEnCoding="utf-8" />                <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">                    <extendedProtectionPolicy policyEnforcement="Never" />                </httpTransport>            </binding>        </customBinding>    </bindings>    <clIEnt>        <endpoint address="http://localhost:41594/Services/DrawingService.svc/Services"            binding="customBinding" bindingConfiguration="wsPlainhttp"            contract="EvalDrawingService.IDrawingService" name="wsPlainhttp" />    </clIEnt></system.serviceModel></configuration>

VS显示错误的位置

public bool EndSaveevalAreaDrawing(System.IAsyncResult result) {            object[] _args = new object[0];            bool _result = ((bool)(base.EndInvoke("SaveevalAreaDrawing",_args,result))); // Here is where is popPing up            return _result;        }

例外

{System.ServiceModel.CommunicationException: The Remote Server returned an error: NotFound. ---> System.Net.WebException: The Remote Server returned an error: NotFound. ---> System.Net.WebException: The Remote Server returned an error: NotFound.   at System.Net.browser.browserhttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)   at System.Net.browser.browserhttpWebRequest.<>c__displayClass5.<EndGetResponse>b__4(Object sendState)   at System.Net.browser.AsyncHelper.<>c__displayClass4.<BeginonUI>b__1(Object sendState)   --- End of inner exception stack trace ---   at System.Net.browser.AsyncHelper.BeginonUI(SendOrPostCallback beginMethod,Object state)   at System.Net.browser.browserhttpWebRequest.EndGetResponse(IAsyncResult asyncResult)   at System.ServiceModel.Channels.httpChannelFactory.httpRequestChannel.httpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)   --- End of inner exception stack trace ---   at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action,Object[] outs,IAsyncResult result)   at System.ServiceModel.ClIEntBase`1.ChannelBase`1.EndInvoke(String methodname,Object[] args,IAsyncResult result)   at EvaluaionAncillaryControl.EvalDrawingService.DrawingServiceClIEnt.DrawingServiceClIEntChannel.EndSaveevalAreaDrawing(IAsyncResult result)   at EvaluaionAncillaryControl.EvalDrawingService.DrawingServiceClIEnt.EvaluaionAncillaryControl.EvalDrawingService.IDrawingService.EndSaveevalAreaDrawing(IAsyncResult result)   at EvaluaionAncillaryControl.EvalDrawingService.DrawingServiceClIEnt.OnEndSaveevalAreaDrawing(IAsyncResult result)   at System.ServiceModel.ClIEntBase`1.OnAsyncCallCompleted(IAsyncResult result)}
解决方法 尝试增加readerQuotas – 在绑定元素中添加此元素

<readerQuotas maxStringContentLength="2147483647" />

http://msdn.microsoft.com/en-us/library/ms731325.aspx

总结

以上是内存溢出为你收集整理的silverlight – 远程服务器返回错误:NotFound全部内容,希望文章能够帮你解决silverlight – 远程服务器返回错误:NotFound所遇到的程序开发问题。

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

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/web/1002763.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存