【问题标题】:Silverlight3.0 + WCF Service hosting issues: Communication ExceptionSilverlight3.0 + WCF 服务托管问题:通信异常
【发布时间】:2010-11-12 07:35:55
【问题描述】:

我正在使用带有 WCF 服务的 silverlight3 工作一段时间。我已经开发并将我的应用程序托管到客户端机器中。它工作得很好。然后我需要在我的应用程序中做一些修改,所以我在我的 .svc 文件中添加了新功能(即在 wcf 服务中)。我已成功更新服务参考。当我重新发布并访问它时,它会在我新添加的特定方法中引发错误。但是其他功能和数据检索工作正常。.wcf服务的新添加功能会引发通信错误。

这是我用来通过从 wcf 服务检索的数据绑定组合框的函数..

实际错误:

System.Reflection.TargetInvocationException:操作过程中发生异常,导致结果无效。检查 InnerException 以获取异常详细信息。 ---> System.ServiceModel.CommunicationException:远程服务器返回错误:NotFound。 ---> System.Net.WebException:远程服务器返回错误:NotFound。 ---> System.Net.WebException:远程服务器返回错误:NotFound。

在 System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)

在 System.Net.Browser.BrowserHttpWebRequest.c_DisplayClass5.b_4(Object sendState)

在 System.Net.Browser.AsyncHelper.c_DisplayClass2.b_0(Object sendState)

---内部异常堆栈跟踪结束---

在 System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, 对象状态)

在 System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult 结果)

---内部异常堆栈跟踪结束---

在 System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult 结果)

在 System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult 结果)

在 System.ServiceModel.ClientBase1.ChannelBase1.EndInvoke(String methodName, Object[] args, IAsyncResult 结果)

在 foundproject.ServiceReference1.Service1Client.Service1ClientChannel.EndUsergetBasedWorkgroup(IAsyncResult 结果)

在 foundproject.ServiceReference1.Service1Client.ServiceReference1_IService1_EndUsergetBasedWorkgroup(IAsyncResult 结果)

在 foundproject.ServiceReference1.Service1Client.OnEndUsergetBasedWorkgroup(IAsyncResult 结果)

在 System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult 结果)

---内部异常堆栈跟踪结束---

在 System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()

在foundproject.ServiceReference1.UsergetBasedWorkgroupCompletedEventArgs.get_Result()

在 foundproject.UserMaster.BindUsers(Object sender, UsergetBasedWorkgroupCompletedEventArgs e)

请帮我解决它..

这对我有很大的帮助..

谢谢 拉克希米.A

【问题讨论】:

    标签: wcf silverlight-3.0


    【解决方案1】:

    webservice 中的所有方法都是使用接口实现的,如果你在 Class 文件中添加了你的函数,请确保它通过它的 interface-template/interface-method 签名来实现。

    您没有更改新添加方法的命名空间。

    访问修饰符是公开的。

    尝试通过右键单击“svc”文件进行浏览,从 IIS 管理控制台运行您的 Web 服务文件“svc”。它必须显示我们通常期望的默认 Web 服务 UI。

    调试您的网络服务,看看它是否在您新添加的方法上遇到断点。

    我相信通过这些简单的步骤,你会解决你的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-09
      • 1970-01-01
      相关资源
      最近更新 更多