【问题标题】:Consuming an external webservice from MS Dynamics CRM 2013 Online Plug-in从 MS Dynamics CRM 2013 Online Plug-in 使用外部 Web 服务
【发布时间】:2015-01-08 14:52:02
【问题描述】:

我在使用 CRM 2013 Online(沙盒)插件中的外部 Web 服务时遇到一些问题,我的问题是“EnvironmentSecurity”。我尝试用控制台做同样的事情,一切都运行良好......我这样调用网络服务:

NetworkCredential myCred = new NetworkCredential();
myCred.Domain = "dom";
myCred.UserName = "user";
myCred.Password = "pass";
CredentialCache credsCache = new CredentialCache();

credsCache.Add(new Uri(webAddress), "Basic", myCred);
HttpWebRequest http = (HttpWebRequest)HttpWebRequest.Create(webAddress);
http.PreAuthenticate = false;

http.UseDefaultCredentials = true;
HttpWebResponse response2 = (HttpWebResponse )http.GetResponse();

错误是这样的:

System.Security.SecurityException: Request for the permission of type
'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=4.0.0.0, 
 Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

【问题讨论】:

标签: web-services crm dynamics-crm-2013 microsoft-dynamics dynamics-crm-online


【解决方案1】:

恐怕您无法使用沙盒中注册的插件调用本地服务(托管在本地服务器中)。相反,请使用需要 DNS 名称解析的命名网址托管服务。

以下 Web 访问限制适用于此沙盒功能。

  1. 只允许使用 HTTP 和 HTTPS 协议。
  2. 不允许访问本地主机(环回)。
  3. 无法使用 IP 地址。您必须使用需要 DNS 名称解析的命名网址。
  4. 支持并推荐匿名身份验证。没有提示登录用户输入凭据或保存这些凭据的规定。

您可以使用有效的网站地址在 Azure/Webserver 中托管您的服务。

欲了解更多信息,请访问link

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-23
    • 2016-02-12
    • 1970-01-01
    • 2016-01-31
    相关资源
    最近更新 更多