Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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 });
}

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();
        }

    }

while running application throwing exception The remote server returned an error: NotFound.for this application
please help , m waiting for response
thanks in advance
Posted
Updated 6-Apr-11 3:13am
v2
Comments
Toniyo Jackson 6-Apr-11 9:14am    
Pre tag added for code
#realJSOP 6-Apr-11 9:16am    
You need to give us the EXACT exception that was thrown.
DeepikaSrivastava 6-Apr-11 9:26am    
full exception is this:
Communication Exception was unhandled by user code:
The remote server returned an error: NotFound.
R. Giskard Reventlov 6-Apr-11 13:26pm    
Have you checked your connection details?
Sandeep Mewara 6-Apr-11 14:57pm    
Configuration issue! Recheck them.

1 solution

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!
 
Share this answer
 
Comments
DeepikaSrivastava 12-Apr-11 6:31am    
Thanks a Lot E.F Nijboer. ,but the above link is not opening at my end, can u please elaborate here in words.
E.F. Nijboer 12-Apr-11 6:53am    
The link is working fine here. The essence is to add this to your config.
<servicedebug includeexceptiondetailinfaults="true">

You could also use fiddler to get some more information about what is happening.

Also, maybe the google webcache can help you out loading this page:
http://webcache.googleusercontent.com/search?q=cache:yfN_841PolcJ:www.mostlydevelopers.com/blog/post/2009/01/14/debugging-tips-ndash3b-the-remote-server-returned-an-error-notfound.aspx+Debugging+Tips+%E2%80%93+The+remote+server+returned+an+error:+NotFound&cd=1&hl=nl&ct=clnk&gl=nl&source=www.google.nl

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900