Tridion 2011 SP1 HR1でコアサービスを偽装しようとすると、次のエラーが発生します。
アクション「http://www.sdltridion.com/ContentManager/CoreService/2011/ISessionAwareCoreService/Impersonate」が無効であるか認識されていないため、メッセージを処理できませんでした。
なぜこれが起こるのですか?なぜそれが機能しないのかわからないように私は盲目でなければなりません...
サーバーについて:Tridion 2011SP1HR1の新規インストール
私のコードは次のようになります。
client = Client.GetCoreService();
if (string.IsNullOrEmpty(username)) username = HttpContext.Current.User.Identity.Name;
client.Impersonate(username);
これはGetCoreServiceメソッドです。
public static SessionAwareCoreServiceClient GetCoreService()
{
AppSettingsReader reader = new AppSettingsReader();
string coreServiceUrl = (string)reader.GetValue("CoreServiceEndPoint", typeof(string));
int dataSize = (int)reader.GetValue("DataSize", typeof(int));
var quotas = new System.Xml.XmlDictionaryReaderQuotas
{
MaxStringContentLength = dataSize,
MaxArrayLength = dataSize,
MaxBytesPerRead = dataSize
};
var httpBinding = new WSHttpBinding
{
MaxReceivedMessageSize = 10485760,
ReaderQuotas = quotas,
Security = { Mode = SecurityMode.Message, Transport = { ClientCredentialType = HttpClientCredentialType.Windows } }
};
var endpoint = new EndpointAddress(coreServiceUrl);
var result = new SessionAwareCoreServiceClient(httpBinding, endpoint);
return result;
}
appsettingsから抽出します(実際のホスト名を「hostname」に置き換えました):
<add key="CoreServiceEndPoint" value="http://hostname/WebServices/CoreService.svc/wsHttp_2010" />
<add key="DataSize" value="41943040" />