首页 文章

连接到CRM 2011 IFD / ADFS中的mscrmservices / 2007 / CrmService.asmx endpoints

提问于
浏览
3

我们刚刚从Microsoft Dynamics CRM 4升级到Microsoft Dynamics CRM 2011.大多数升级都很顺利,但我有一些自定义代码(为CRM 4编写),它是作为CRM 4 ISV文件夹中的ASPX页面实现的 . 此代码自升级后已停止工作 .

我们的Dynamics CRM 2011服务器设置为On Premise,作为IFD部署 .

代码连接到CRM服务器,如下所示:

using (new CrmImpersonator())
         {
             string crmurl = "https://<server>:444/<org>/mscrmservices/2007/CrmService.asmx";
             string orgname = <org>;

             CrmAuthenticationToken token = CrmAuthenticationToken.ExtractCrmAuthenticationToken(context, orgname);
             token.OrganizationName = orgname;

             token.AuthenticationType = 0;

             CrmService service = new CrmService();
             service.Credentials = System.Net.CredentialCache.DefaultCredentials;
             service.CrmAuthenticationTokenValue = token;
             service.Url = crmurl;

             WhoAmIRequest who = new WhoAmIRequest();
             WhoAmIResponse whoResponse = (WhoAmIResponse)service.Execute(who);

发送WhoAmIRequest后,我收到以下异常:

The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="https://<server>:444/<org>/mscrmservices/2007/CrmService.asmx">here</a>.</h2>
</body></html>

--.

at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Microsoft.Crm.SdkTypeProxy.CrmService.Execute(Request Request)
at ForecastConverterWeb.CashflowForecast.ToCrm(HttpContext context)
at ForecastConverterWeb._Default.submitbtn_click(Object sender, EventArgs e)

似乎当代码尝试将请求发送到https://:444 // mscrmservices / 2007 / CrmService.asmx时,页面返回一个重定向到的链接,以及......本身(https://:444 // mscrmservices / 2007 / CrmService.asmx) .

我've tried using the internal address (port 5555), external IFD address (https over port 444) and internal IFD (https over port 444) address all with the same result. I know that in CRM 2011 ISV is being depreciated, but the considering the amount of time it would take to re-develop this software (and the fact that considering it'支持的代码,我不应该只是让它工作正常(根据这个:http://msdn.microsoft.com/en-us/library/gg309571.aspx

我很感激任何人都可以提供任何帮助 .

1 回答

  • 3

    您的代码使您看起来像是将组织名称放在主机和/2007/crmservice.asmx的路径之间 . 不要那样做 . 我知道你必须在内部部署时将组织名称添加到ISV目录中的自定义aspx / asmx文件,但据我所知,它不适用于crmservice.asmx .

相关问题