Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/271.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Windows phone 8通信异常远程服务器返回错误:NotFound_C#_Wcf_Windows Phone 8_Windows Phone_Wcf Data Services - Fatal编程技术网

C# Windows phone 8通信异常远程服务器返回错误:NotFound

C# Windows phone 8通信异常远程服务器返回错误:NotFound,c#,wcf,windows-phone-8,windows-phone,wcf-data-services,C#,Wcf,Windows Phone 8,Windows Phone,Wcf Data Services,我想问一个一直让我发疯的问题@_@ 我已经为WindowsPhone8制作了一个从wcf服务中检索数据的应用程序。 幸运的是,我的同事帮了我一把。但是,当我使用该服务时,我得到了这个错误 System.ServiceModel.CommunicationException was unhandled by user code HResult=-2146233087 Message=The remote server returned an error: NotFound. Sourc

我想问一个一直让我发疯的问题@_@ 我已经为WindowsPhone8制作了一个从wcf服务中检索数据的应用程序。 幸运的是,我的同事帮了我一把。但是,当我使用该服务时,我得到了这个错误

System.ServiceModel.CommunicationException was unhandled by user code
  HResult=-2146233087
  Message=The remote server returned an error: NotFound.
  Source=System.ServiceModel
  StackTrace:
       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 NavFinance.NavFinData.NavcoreNavfinServiceClient.NavcoreNavfinServiceClientChannel.EndGetAll(IAsyncResult result)
       at NavFinance.NavFinData.NavcoreNavfinServiceClient.NavFinance.NavFinData.INavcoreNavfinService.EndGetAll(IAsyncResult result)
       at NavFinance.NavFinData.NavcoreNavfinServiceClient.OnEndGetAll(IAsyncResult result)
       at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
  InnerException: System.Net.WebException
       HResult=-2146233079
       Message=The remote server returned an error: NotFound.
       Source=System.Windows
       StackTrace:
            at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
            at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
            at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
       InnerException: System.Net.WebException
            HResult=-2146233079
            Message=The remote server returned an error: NotFound.
            Source=System.Windows
            StackTrace:
                 at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
                 at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClasse.<EndGetResponse>b__d(Object sendState)
                 at System.Net.Browser.AsyncHelper.<>c__DisplayClass1.<BeginOnUI>b__0(Object sendState)
            InnerException:
你们所有人的任何回答都会让我想得更多,请回答

问候,,
Budi Prasetyo

此错误表示您的应用程序无法与服务通信。您是否在手机/模拟器Internet Explorer中尝试服务URL以确保URL可访问?

哇,太棒了。。!! 在为这个错误痛苦了3天后,终于发现了一些东西。:)

所有的功劳都应该归功于 多谢了,伙计,为什么我还没有意识到这一点呢。 最后,我仅通过将仿真器连接到internet才能从我的服务中获取数据

在我的例子中,我通常使用有线连接,而这在模拟器上根本不起作用。 搜索后,我将连接更改为无线连接。 然后,它的工作和完成


非常感谢。:)

无需额外操作,只需关闭公共和私人的防火墙,然后等待2-3分钟,然后运行应用程序。它将运行完美


我试过了,效果很好。

我试过了,效果很好。我在模拟器上使用IE打开服务。但是,我使用wifi连接,可以使模拟器连接到互联网。是吗?@josue Yeray,这个问题可能有什么问题?@BudiPrasetyo windows phone emulator是一个虚拟机,要在您的windows机器中使用服务,您需要确保防火墙允许80端口的连接,最好使用您的机器IP作为url…我也面临这个问题
public PurchaseInvoiceMainPage()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(purchaseInvoice_Loaded);
        }

        private void purchaseInvoice_Loaded(object sender, RoutedEventArgs e)
        {
            NavcoreNavfinServiceClient client = new NavcoreNavfinServiceClient();
            client.GetAllCompleted += new EventHandler<GetAllCompletedEventArgs>(client_getAllPurchaseInvoice);
            client.GetAllAsync("509A7214-D3A9-47E7-9BB4-232E670ED650");
        }

        private void client_getAllPurchaseInvoice(object sender, GetAllCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                purchaseDataList.ItemsSource = e.Result;
            }
        }
public System.Collections.ObjectModel.ObservableCollection<NavFinance.NavFinData.vwPurchaseInvoice> EndGetAll(System.IAsyncResult result) {
                object[] _args = new object[0];
                System.Collections.ObjectModel.ObservableCollection<NavFinance.NavFinData.vwPurchaseInvoice> _result = ((System.Collections.ObjectModel.ObservableCollection<NavFinance.NavFinData.vwPurchaseInvoice>)(base.EndInvoke("GetAll", _args, result)));
                return _result;
            }
System.Collections.ObjectModel.ObservableCollection<NavFinance.NavFinData.vwPurchaseInvoice> _result = ((System.Collections.ObjectModel.ObservableCollection<NavFinance.NavFinData.vwPurchaseInvoice>)(base.EndInvoke("GetAll", _args, result)));
http://dev.navcore.com/NavFinWebService/Navcore.Navfin.Service.NavcoreNavfinService.svc