简体   繁体   English

带有crm sdk的adwords API客户端库C#

[英]adwords api client library c# with crm sdk

I have a solution on c#. 我对C#有解决方案。 It consists of latest google adwords client library and 3 my projects. 它由最新的google adwords客户端库和3个我的项目组成。

One of these projects uses client library and third project which provides class getting crm sdk IOrganizationService. 这些项目之一使用客户端库,而第三个项目则提供获取crm sdk IOrganizationService的类。 Second also uses crm connection class and they work properly. 其次还使用crm连接类,它们可以正常工作。

The project using client library worked properly till today but now It can't get IorganizationService from crmconnector class with Exception that xrm sdk can't resolve the url. 到目前为止,使用客户端库的项目都可以正常工作,但是现在无法从crmconnector类获取IorganizationService,但xrm sdk无法解析url。 But with second project everything is OK. 但是对于第二个项目,一切都很好。

May be there is some conflict of client library and crm sdk. 客户端库和crm sdk可能存在一些冲突。 May someone know the issue. 可能有人知道这个问题。

all 3 files use this in using section 所有3个文件在“使用”部分中都使用此

using Microsoft.Xrm.Sdk; 
using Microsoft.Crm.Sdk; 
using Microsoft.Crm.Sdk.Messages; 
using Microsoft.Xrm.Client; 
using Microsoft.Xrm.Sdk.Client; 
using Microsoft.Xrm.Sdk.Query; 
using Microsoft.Xrm.Client.Services; 

CrmConnector has credentials as static fields and return IOrganizationService from static method CrmConnector具有凭据作为静态字段,并从静态方法返回IOrganizationService

public class CrmConnector
    {
        private static string _url = "http://crmsrv:5255/TestBaseSNT/XRMServices/2011/Organization.svc"; //it's the internal url
        private static string _login = "hrach";
        private static string _domain = "mscnt";
        private static string _psw = "hgfYTR43@!";




        public static IOrganizationService GetService()
        {
            ClientCredentials Credentials = new ClientCredentials();
            Uri OrganizationUri;

            Credentials.Windows.ClientCredential = new NetworkCredential(_login, _psw, _domain);
            OrganizationUri = new Uri(_url);

            Uri HomeRealmUri = null;
            OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(OrganizationUri, HomeRealmUri, Credentials, null);
            return (IOrganizationService)serviceProxy;

        }

    }

There is an inner exception with message 消息有内部异常

Value 'type' can't be resolved. 值“类型”无法解析。 unable to load type from "Google.Api.Ads.Common.Lib.SoapListenerExtension" from "Google.Ads.Common". 无法从“ Google.Ads.Common”加载“ Google.Api.Ads.Common.Lib.SoapListenerExtension”类型。 (C:\\Users\\hrach\\Desktop\\SntAdwords\\Stat\\bin\\Debug\\StatAdwords.vshost.exe.Config line 125) (C:\\ Users \\ hrach \\ Desktop \\ SntAdwords \\ Stat \\ bin \\ Debug \\ StatAdwords.vshost.exe.Config第125行)

我删除了由adwords客户端库提供的system.web部分表格app.config,这并没有影响从google adwords获取报告,并修复了与crm /

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM