问题描述
您好,
我是AdCenter API的新手。我目前正在更新与新API版本8版本3相对应的代码。由于我使用的是Java,因此我抓住了WSDL代码并从wsdl生成了Jars作为我的库。
我发现在新的软件包中没有CustomerServiceLocator,它曾用于获取客户管理服务。有没有其他方式来获得服务? (Campaign Service中的问题相同)。
以下是获取CustomerManagementService的代码:
CustomerManagementServiceLocator customerManagementServiceLocator = new CustomerManagementServiceLocator();
customerManagementServiceLocator.setBasicHttpBinding_ICustomerManagementServiceEndpointAddress(adCenterCredentials
.getCustomerManagementUrl());
ICustomerManagementService customerManagementService = customerManagementServiceLocator.getBasicHttpBinding_ICustomerManagementService();
BasicHttpBinding_ICustomerManagementServiceStub stub =(BasicHttpBinding_ICustomerManagementServiceStub)customerManagementService;
stub.setTimeout(timeoutMillis);
stub.setHeader(namespace," ApplicationToken","");
stub.setHeader(namespace," DeveloperToken",adCenterCredentials.getDeveloperToken());
stub.setHeader(namespace," UserName",adCenterCre dentials.getUserName());
stub.setHeader(namespace," Password",adCenterCredentials.getPassword());
有人能告诉我在新API中该怎么办?
Hi there,
I'm a newbie to the AdCenter API. I'm currently updating my code corresponding to the new API release Version 8 Release 3. Since I'm using Java, I grabbed the WSDL code and generated Jars from wsdl as my libraries.
I found that there's no CustomerServiceLocator, which used to be used to get Customer Management Service, in the new package. Is there an alternative way to get the service? (Same problem in Campaign Service).
Below is my code to get the CustomerManagementService:
CustomerManagementServiceLocator customerManagementServiceLocator = new CustomerManagementServiceLocator();
customerManagementServiceLocator.setBasicHttpBinding_ICustomerManagementServiceEndpointAddress(adCenterCredentials
.getCustomerManagementUrl());
ICustomerManagementService customerManagementService = customerManagementServiceLocator.getBasicHttpBinding_ICustomerManagementService();
BasicHttpBinding_ICustomerManagementServiceStub stub = (BasicHttpBinding_ICustomerManagementServiceStub) customerManagementService;
stub.setTimeout(timeoutMillis);
stub.setHeader(namespace, "ApplicationToken", "");
stub.setHeader(namespace, "DeveloperToken", adCenterCredentials.getDeveloperToken());
stub.setHeader(namespace, "UserName", adCenterCredentials.getUserName());
stub.setHeader(namespace, "Password", adCenterCredentials.getPassword());
Could anyone tell me what should I do in the new API?
这篇关于如何在新API中获取客户管理服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!