简体   繁体   English

Windows 8应用程序拒绝在运行代理的情况下连接到Azure服务

[英]Windows 8 app refuses to connect to Azure service with a proxy running

I've got an app in the Windows 8 store that uses a WCF service hosted on Azure. 我在Windows 8商店中有一个使用Azure托管的WCF服务的应用程序。 When I use my proxy program, UltraSurf , the app fails to connect to the service with this error: 当我使用代理程序UltraSurf时 ,该应用程序无法连接到服务,并出现以下错误:

The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8). 响应消息的内容类型text / html与绑定的内容类型不匹配(text / xml; charset = utf-8)。 If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. 如果使用自定义编码器,请确保正确实施IsContentTypeSupported方法。 The first 472 bytes of the response were: ' 响应的前472个字节为:'

The requested URL could not be retrieved 所请求的网址无法检索

'. '。

The URL mentioned in the quote is the default 'can't find the page Url' that UltraSurf produces and so the error message is probably of no use. 引用中提到的URL是UltraSurf生成的默认“找不到页面URL”,因此错误消息可能没有用。 The question is, why/how does Ultrasurf block/get in the way of my connection? 问题是,Ultrasurf为什么/如何阻止/阻碍我的连接?

Can anybody shed some light on what's going on and why it fails connect please? 任何人都可以了解发生了什么,为什么连接失败?

Thanks! 谢谢!

Working without much information here, but I'd suspect that the problem is that the proxy is just being a little picky. 这里工作时没有太多信息,但是我怀疑问题在于代理只是有点挑剔。

I believe that your error message basically says, "I'm expecting to get back 'text/xml' data, but what I see is 'text/html' data". 我相信您的错误消息基本上会说:“我希望取回'text / xml'数据,但我看到的是'text / html'数据”。 That's probably not because it can actually see 'text/html' data coming back, but rather, because it's not seeing the content type header from the response telling it that it is xml data. 那可能不是因为它实际上可以看到'text / html'数据回来,而是因为没有看到响应中的内容类型标头告诉它它 xml数据。

I don't know exactly how you implemented your WCF service, or what type of data it's set up to return, but you might want to ensure that you explicitly set the content type somewhere in your code before the return and see what happens. 我不知道您是如何实现WCF服务的,也不清楚要设置返回的数据类型,但是您可能想要确保在返回之前在代码中的某处显式设置内容类型,然后看看会发生什么。 Something like: 就像是:

Response.ContentType = "text/xml";

The only other thing that springs to mind is that your application might be picky about the content type for XML in general. 我唯一想到的另一件事是,您的应用程序通常对XML的内容类型可能很挑剔。 There's a bit of, um... subtle difference ... around whether the appropriate content type for XML is 'application/xml' or 'text/xml'. 关于XML的适当内容类型是'application / xml'还是'text / xml',有一些细微的区别 It's possible that your service is presenting the one that your proxy doesn't like? 您的服务是否可能呈现代理不喜欢的服务?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows Mobile App的WCF服务正在运行,但无法连接 - WCF Service for Windows Mobile App running but I cannot connect 在Azure中运行自定义Windows服务 - Running a custom Windows Service in Azure Windows服务以用户(MFA)身份连接到Azure AD - Windows Service connect to Azure AD as User (MFA) 应用程序绝对拒绝对本地主机请求使用代理 - App absolutely refuses to use proxy for localhost requests 如何通过代理连接到 Azure 服务总线主题 - C#? - How to connect to Azure Service Bus Topic through proxy - C#? 在 Azure 应用服务 Linux 中运行 Puppeteer - Running Puppeteer in Azure App Service Linux JsonProperty似乎无法在Windows Azure应用程序服务上运行 - JsonProperty seems to not working on a windows azure app service 使用Azure App Service中的Powershell命令连接到Azure AD - Connect to Azure AD using Powershell commands from Azure App Service 尝试连接到(localdb)而不是Azure SQL的Azure云服务应用 - Azure Cloud Service App trying to connect to (localdb) instead of Azure SQL 作为Windows服务运行时应用程序的异常行为 - Strange behaviour of app when running as windows service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM