远程服务器的Azure返回NOTFOUND错误(未授权) [英] Remote Azure server returning NotFound error (Unauthorized)
问题描述
我已经创建了在Azure上的虚拟机上安装的Windows Server 2012和SQL Server 2012。此外,我已经打开入站端口80和1433上的虚拟机开放。
I have created a virtual machine on Azure with Windows Server 2012 and SQL Server 2012 installed on it. Also i have opened inbound port 80 and 1433 open on vm.
我已经建立一个数据库,并报告(RDL)并部署到服务器
I have created a database and reports (rdl) and deployed to the server.
当我写一个简单的WinForms应用程序就能够呈现托管在虚拟机的ReportServer报告。
When I write a simple WinForms application it is able to render the report hosted on the vm's ReportServer.
现在我写一个WP7应用程序进行通信,并从远程服务器获取XML。这一次,我发现了一个错误:
Now I am writing a WP7 application to communicate and get xml from remote server. This time I'm getting an error:
远程服务器返回错误:NOTFOUND
The remote server returned an error: NotFound
的InnerException:System.Net.HttpStatus code.Unauthorized
InnerException: System.Net.HttpStatusCode.Unauthorized
我不知道是哪里的问题;我需要从服务器端做什么?
I am not sure where the problem is; do I need to do anything from server side?
客户端
下面是我的配置和code:
Below is my config and code:
1)我添加了一个服务参考的reportserver在<一提到href=\"http://stackoverflow.com/questions/13854356/downloading-xml-file-from-sql-reporting-server\">this帖子及以下ServiceReferences.ClientConfig文件:
1) I have added a service reference to the reportserver as mentioned in this post and below is ServiceReferences.ClientConfig file:
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ReportExecutionServiceSoap" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://virtualmachine.cloudapp.net:80/ReportServer/ReportExecution2005.asmx"
binding="basicHttpBinding" bindingConfiguration="ReportExecutionServiceSoap"
contract="ServiceReference1.ReportExecutionServiceSoap" name="ReportExecutionServiceSoap" />
</client>
</system.serviceModel> </configuration>
2),下面是我的code:
2) Below is my code:
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
ReportExecutionServiceSoapClient client = new ReportExecutionServiceSoapClient();
client.LogonUserCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(client_LogonUserCompleted);
client.LogonUserAsync("username", "password", "virtualmachine.cloudapp.net");
}
下面的用户名是管理员,我用它来登录到虚拟机。请问这是什么问题?
Here username is 'administrator' which i use to login to virtual machine. Would that be a problem?
服务器端
下面是我的ReportServer \\的web.config
Below is my Reportserver\web.config
<authentication mode="Windows" />
<identity impersonate="true" />
和下面是我的ReportServer \\ rsreportserver.config
And below is my Reportserver\rsreportserver.config
<Authentication>
<AuthenticationTypes>
<RSWindowsNTLM/>
</AuthenticationTypes>
<RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel>
<RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario>
<EnableAuthPersistence>true</EnableAuthPersistence>
推荐答案
尝试登录到您的帐户windows.azure.com,选择虚拟机,然后选择顶部的端点连接。
Try logging into your windows.azure.com account and select the VM, then select the Endpoint link at the top.
请确保您添加一个终点,是这样的:
Make sure you add an endpoint, something like:
名称:ReportsEndpoint
Name: ReportsEndpoint
协议:TCP
公共端口:80
私有端口:80
这篇关于远程服务器的Azure返回NOTFOUND错误(未授权)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!