WindowsServer2012とSQLServer2012がインストールされたAzure上に仮想マシンを作成しました。また、VMでインバウンドポート80と1433を開いています。
データベースとレポート(rdl)を作成し、サーバーにデプロイしました。
単純なWinFormsアプリケーションを作成すると、VMのReportServerでホストされているレポートをレンダリングできます。
現在、通信してリモートサーバーからxmlを取得するためのWP7アプリケーションを作成しています。今回はエラーが発生します:
リモートサーバーがエラーを返しました:NotFound
InnerException:System.Net.HttpStatusCode.Unauthorized
問題がどこにあるのかわかりません。サーバー側から何かする必要がありますか?
クライアント側
以下は私の設定とコードです:
1)この投稿に記載されているように、レポートサーバーにサービス参照を追加しました。以下は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");
}
ここで、ユーザー名は「administrator」で、仮想マシンへのログインに使用します。それは問題になりますか?
サーバ側
以下は私の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>