次の方法で参照できる SharePoint サーバーがあります。
//DCP connection
private static dcp.Lists lists = new dcp.Lists();
lists.Credentials = System.Net.CredentialCache.DefaultCredentials;
lists.Url = Values.SERVERADDRESS + "/_vti_bin/lists.asmx";
SERVERADDRESS
これは、ドメイン認証 ( value )のみを持つポートを介して機能しますhttp://dcp:17649
。ただし、ブラウザは と を介して他の認証方法を使用しhttp://
ますhttps://
。これらはクレーム ベースであり、外部ユーザー用のフォーム ベース認証と、ドメイン上のユーザー用の NTLM 認証が含まれています。ただし、これらのポートを介してこれにアクセスできないようです。これが私のコードです:
//create networkCredential
System.Net.NetworkCredential nc = System.Net.CredentialCache.DefaultNetworkCredentials;
System.Net.CredentialCache cc = new System.Net.CredentialCache();
//add into CredentialCache and speicfy the NTLM authType
cc.Add(new Uri(Values.SERVERADDRESS + "/_vti_bin/lists.asmx"), "NTLM", nc);
lists.Credentials = cc;
lists.Url = Values.SERVERADDRESS + "/_vti_bin/lists.asmx";
SERVERADDRESS
値はhttp://dcp
ここにあります。
app.config の変更に関係するいくつかの投稿がインターネット上 (ここにもあります) にあります。ただし、私のものは、これらの投稿で見つけることができるものとはまったく異なります。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="DriverDevPlanning.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<applicationSettings>
<DriverDevPlanning.Properties.Settings>
<setting name="DriverDevPlanning_dcp_Lists" serializeAs="String">
<value>http://dcp/_vti_bin/Lists.asmx</value>
</setting>
<setting name="DriverDevPlanning_dcp_UserGroup_UserGroup" serializeAs="String">
<value>http://dcp/_vti_bin/usergroup.asmx</value>
</setting>
</DriverDevPlanning.Properties.Settings>
</applicationSettings>
</configuration>