gpt4 book ai didi

azure - 远程 Azure 服务器返回 NotFound 错误(未经授权)

转载 作者:行者123 更新时间:2023-12-02 07:31:57 24 4
gpt4 key购买 nike

我已在 Azure 上创建了一个虚拟机,其中安装了 Windows Server 2012 和 SQL Server 2012。我还打开了虚拟机上的入站端口 80 和 1433。

我已经创建了一个数据库和报告 (rdl) 并部署到服务器。

当我编写一个简单的 WinForms 应用程序时,它能够呈现托管在虚拟机的 ReportServer 上的报告。

现在我正在编写一个 WP7 应用程序来通信并从远程服务器获取 xml。这次我收到错误:

The remote server returned an error: NotFound

InnerException: System.Net.HttpStatusCode.Unauthorized

不知道问题出在哪里;我需要从服务器端做任何事情吗?

客户端

下面是我的配置和代码:

1) 我已向报告服务器添加了服务引用,如 this post 中所述。下面是 ServiceReferences.ClientConfig 文件:

<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)下面是我的代码:

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");
}

这里的用户名是“管理员”,我用它来登录虚拟机。这会是一个问题吗?

服务器端

下面是我的 Reportserver\web.config

<authentication mode="Windows" />
<identity impersonate="true" />

下面是我的 Reportserver\rsreportserver.config

<Authentication>
<AuthenticationTypes>
<RSWindowsNTLM/>
</AuthenticationTypes>
<RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel>
<RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario>
<EnableAuthPersistence>true</EnableAuthPersistence>

最佳答案

尝试登录您的 windows.azure.com 帐户并选择虚拟机,然后选择顶部的端点链接。

确保添加端点,例如:

名称:ReportsEndpoint

协议(protocol):TCP

公共(public)端口:80

私有(private)端口:80

关于azure - 远程 Azure 服务器返回 NotFound 错误(未经授权),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14672548/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com