Web服务错误内部异常:{“远程服务器返回错误:NotFound"" [英] Web Service Error Inner Exception: {"The remote server returned an error: NotFound"}

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

问题描述


我已经使用了很多这个网站,你们已经节省了我几次工作.非常感谢,开始了.
我不确定本节是否要发布此问题.这是我的第一篇文章.
我有一个简单的ASP.NET Web服务(C#VS 2008),它从MS SQL Server 2005读取一个表并返回一个包含该表的XML rep的字符串(使用WriteXML获取).当我运行此Web服务时,将在资源管理器中成功显示字符串.但是我试图使用httpwebresponce从Windows Phone应用程序调用它,它引发异常{远程服务器返回错误:NotFound."}
当我使用WebClient调用它时,它什么也不做(不起作用).这是我从WP7发出的呼叫的样子:

Hi,
I have used this site a lot and you guys have saved my job couple of times. Thanks a lot, for the start.
I am not sure if this section to post this question. Its my first post here.
I have a simple ASP.NET Web Service (C# VS 2008) that reads a table from MS SQL Server 2005 and returns a string contain the XML rep of that table (acquired using WriteXML). When I run this Web Service is displays the string successfully in Explorer. But I am trying to call it from a Windows Phone App using httpwebresponce it raise the exception {"The remote server returned an error: NotFound."}
It does nothing (not working) when I call it using WebClient. Here is what my call from WP7 looks like:

...

 HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(new Uri("http://localhost:3808/GatherService.asmx/TestMTD"));

 request.BeginGetResponse(new AsyncCallback(ReadCallback), request);
            return XMLtxt;
 }

        private void ReadCallback(IAsyncResult asynchronousResult)
        {
            HttpWebRequest request =
           (HttpWebRequest)asynchronousResult.AsyncState;
            HttpWebResponse response =
           (HttpWebResponse)request.EndGetResponse(asynchronousResult);
            using (StreamReader streamReader1 =
           new StreamReader(response.GetResponseStream()))
            {
                string resultString = streamReader1.ReadToEnd();
                XMLtxt = HttpUtility.HtmlEncode(resultString);
            }
        }

推荐答案

我怀疑您的服务部署.您的服务是否部署在3808端口上?当客户端调用您的服务时,请确保您的服务正在运行.
I am suspecting with your service deployment. Is your service deployed on port no 3808? Make sure your service is running when client is calling your service.


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

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