远程服务器返回错误:NotFound: [英] The remote server returned an error: NotFound:

查看:105
本文介绍了远程服务器返回错误:NotFound:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在WCF服务中使用此功能

using this function in WCF service

      [OperationContract]
public IQueryable SelectAllTesting()
{
DataClasses1DataContext db = new DataClasses1DataContext();

return (IQueryable)(from a in db.Employees
                    join b in db.Companys on a.Employeeid equals b.Employeeid
                     select new { a.Employeeid, a.EmployeeName, b.Companyname });
}


和mainPage.xaml中的调用类似:


And A call in mainPage.xaml like:

public partial class MainPage : UserControl
    {
        ServiceReference1.Service1Client client = new ServiceReference1.Service1Client();

        public MainPage()
        {
            InitializeComponent();

        }

        void client_SelectAllTestingCompleted(object sender, ServiceReference1.SelectAllTestingCompletedEventArgs e)
        {
            MessageBox.Show(e.ToString());
            dataGrid1.ItemsSource = (IQueryable)e.Result;
            MessageBox.Show(e.ToString());
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            client.SelectAllTestingCompleted += new EventHandler<ServiceReference1.SelectAllTestingCompletedEventArgs>(client_SelectAllTestingCompleted);
            client.SelectAllTestingAsync();
        }

    }


运行应用程序引发异常时,远程服务器针对此应用程序返回错误:NotFound.
请帮助,正在等待回复
在此先感谢


while running application throwing exception The remote server returned an error: NotFound.for this application
please help , m waiting for response
thanks in advance

推荐答案

您是否包含异常详细信息?在这里看看:
http: //www.mostlydevelopers.com/blog/post/2009/01/14/debugging-tips-ndash3b-the-remote-server-returned-an-error-notfound.aspx [
Do you include exception details? Have a look here:
http://www.mostlydevelopers.com/blog/post/2009/01/14/debugging-tips-ndash3b-the-remote-server-returned-an-error-notfound.aspx[^]

If that doesn''t give you any more information it is clearly a client side problem. You should check your url and firewall/security settings. Can you connect using WcfTestClient.exe? Is is working when you run both on the same machine? Hopefully this can help you on your way.

Good luck!


这篇关于远程服务器返回错误:NotFound:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆