从所有Web服务调用抛出UriFormatException,但我的Url已设置且有效 [英] UriFormatException thrown from all web service calls, but my Url is set and valid

查看:79
本文介绍了从所有Web服务调用抛出UriFormatException,但我的Url已设置且有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用源自SoapHttpClientProtocol的代理的旧式Web服务。  它完美地工作了一段时间,突然现在它将在发布模式下编译并在IE Mobile中下载时工作,但是当单步执行
调试器时,每次调用Invoke  SoapHttpClientProtocol.Invoke都会失败。

I'm using old fashioned web services with a proxy derived from SoapHttpClientProtocol.  It was working perfectly for a while, and suddenly now it will work when compiled in release mode and downloaded in IE Mobile, but when stepping through the debugger, the call to Invoke SoapHttpClientProtocol.Invoke fails every time.

我查看了我的网址,它完全有效。  我可以在浏览器中导航到Web服务页面。  但是在Invoke的调用堆栈深处,Uris更改为"http://"。

I checked my Url and it's totally valid.  I can navigate to the web service page in a browser.  But deep within the call stack from Invoke, the Uris change to "http://".

UriFormatException

无效的URI:主机名可以不被解析。

UriFormatException
Invalid URI: The hostname could not be parsed.

调用堆栈:

  System.dll !System.Uri.CreateThis(string uri =" http://" ;, bool dontEscape = false,System.UriKind uriKind = Absolute)+ 0xc4 bytes·
  System.dll!System.Uri.Uri(string uriString =" http://")+ 0x1d bytes


  System.dll!System.Net.WebProxy.CreateProxyUri(string Address =" http: //")+ 0x27字节


  System.dll!System.Net.WebProxy.WebProxy(string Address ="" ;, bool BypassOnLocal = false)


  System.dll!System.Net.HttpWebRequest.SubmitRequest()+ 0x83 bytes


  System.dll!System.Net.HttpWebRequest.finishGetResponse()+ 0x21 bytes


  System.dll!System.Net.HttpWebRequest.GetResponse()+ 0x6 bytes < span style ="white-space:pre">


  System.Web.Services .dll!System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(System.Net.WebRequest request = {System.Net.HttpWebRequest})+ 0x3 bytes


  System.Web.Services.dll!System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(System .Net.WebRequest request = {System.Net.HttpWebRequest})


  System.Web.Services.dll!System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke(string methodName =" GetDeviceInstallerFileList",object [] parameters = {object [0]},System。 Web.Services.Protocols.WebClientAsyncResult
asyncResult = null)+ 0x346 bytes

  System.Web.Services.dll!System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(string methodName =" GetDeviceInstallerFileList",object [] parameters = {object [0]})


> Blah.exe! MyWebserviceProxy.GetDeviceFileList()第39行
C#

  System.dll!System.Uri.CreateThis(string uri = "http://", bool dontEscape = false, System.UriKind uriKind = Absolute) + 0xc4 bytes
  System.dll!System.Uri.Uri(string uriString = "http://") + 0x1d bytes
  System.dll!System.Net.WebProxy.CreateProxyUri(string Address = "http://") + 0x27 bytes
  System.dll!System.Net.WebProxy.WebProxy(string Address = "", bool BypassOnLocal = false)
  System.dll!System.Net.HttpWebRequest.SubmitRequest() + 0x83 bytes
  System.dll!System.Net.HttpWebRequest.finishGetResponse() + 0x21 bytes
  System.dll!System.Net.HttpWebRequest.GetResponse() + 0x6 bytes
  System.Web.Services.dll!System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(System.Net.WebRequest request = {System.Net.HttpWebRequest}) + 0x3 bytes
  System.Web.Services.dll!System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(System.Net.WebRequest request = {System.Net.HttpWebRequest})
  System.Web.Services.dll!System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke(string methodName = "GetDeviceInstallerFileList", object[] parameters = {object[0]}, System.Web.Services.Protocols.WebClientAsyncResult asyncResult = null) + 0x346 bytes
  System.Web.Services.dll!System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(string methodName = "GetDeviceInstallerFileList", object[] parameters = {object[0]})
> Blah.exe!MyWebserviceProxy.GetDeviceFileList() Line 39 C#

这让我完全陷入困境。有什么想法吗?

This has got me completely stumped. Any ideas?

推荐答案

我建议您调试代码并检查网址;值,然后在IE中复制它以检查它是否可用。

I suggest you debug the code and check the url value, then copy it in IE to check whether it is available.

如果仍然无法解决,请提供url字符串值吗?

If you still can't solve it, could you please provide the url string value?

 

最好的问候,

Guang-Ming Bian - MSFT

Best regards,
Guang-Ming Bian - MSFT


这篇关于从所有Web服务调用抛出UriFormatException,但我的Url已设置且有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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