帮助调用CustomerManagementService.getAccounts / getAccountsInfo [英] Help calling CustomerManagementService.getAccounts / getAccountsInfo

查看:61
本文介绍了帮助调用CustomerManagementService.getAccounts / getAccountsInfo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试调用v6 CustomerManagementService的getAccounts方法(或v7中的getAccountsInfo)。

I'm trying to call the getAccounts method of the v6 CustomerManagementService (or getAccountsInfo in v7).

我找到的代码示例,位于http:// msdn.microsoft.com/en-us/library/bb267277.aspx,对我不起作用,因为我不知道ApiUserAuthHeader类来自何处。  我从v6 wsdl生成了Java代码,但没有创建这样的类。
 所以我修改了代码示例来设置auth标头,就像我找到的其他v6示例一样(例如http://msdn.microsoft.com/en-us/library/cc512748.aspx)。  当我使用修改后的代码运行测试时,我收到错误消息

The code sample that I found, located at http://msdn.microsoft.com/en-us/library/bb267277.aspx, doesn't work for me because I don't know where the ApiUserAuthHeader class comes from.  I generated Java code from the v6 wsdl, and no such class was created.  So I modified the code sample to set auth headers as in other v6 examples that I had found (such as http://msdn.microsoft.com/en-us/library/cc512748.aspx).  When I ran a test using my modified code, I got an error saying

org.apache.axis.AxisFault:服务器无法处理请求。 ---> | -400001 | -1 ||

org.apache.axis.AxisFault: Server was unable to process request. ---> |-400001|-1||

在记录的信息中找回一点,我看到另一条错误消息:

Digging back a bit into the logged information, I see another error message:

org。 apache.axis.ConfigurationException :没有名为http://adcenter.microsoft.com/syncapis/GetAccounts的服务可用

org.apache.axis.ConfigurationException: No service named http://adcenter.microsoft.com/syncapis/GetAccounts is available

所以,我不确定我做错了什么。  它可能与命名空间有关,由于某种原因,命名空间是"syncapis"。而不是"v6"而不是"v6"就像在ReportService示例中一样。

So, I am not sure what I am doing wrong.  It may have to do with the namespace, which for some reason is "syncapis" instead of "v6" as it had been in the ReportService example.

我的下一步是尝试使用v7。  我没有在v7中找到CustomerManagementService的代码示例,但我找到了一个适用于CampaignManagementService的代码示例。  当我运行此v7测试时,我收到错误消息

My next move was to try to use v7.  I did not find a code sample for the CustomerManagementService in v7, but I did find one for CampaignManagementService, which I adapted.  When I run this v7 test, I get an error saying

无效的客户端数据。检查SOAP故障详细信息以获取更多信息

Invalid client data. Check the SOAP fault details for more information

重新登录日志,我发现消息

Digging back into the logs, I find the message

身份验证失败。提供的凭据无效或帐户处于非活动状态

Authentication failed. Either supplied credentials are invalid or the account is inactive

我使用的是相同的用户名,密码和开发令牌,我可以运行ReportService方法。  所以,也许我在SOAP标头中设置身份验证时做错了。  但我正在关注我为CampaignManagment服务找到的
的示例代码,可在http://msdn.microsoft.com/en-us/library/cc728898.aspx找到。

I am using the same username, password, and dev token for which I was able to run a ReportService method.  So, perhaps I am doing something wrong in setting up the authentication in the SOAP headers.  But I am following the sample code that I found for the CampaignManagment service, found at http://msdn.microsoft.com/en-us/library/cc728898.aspx.

我为这篇长篇文章道歉,但我希望有人能指出我正确的方向。

I apologize for the long post, but I am hoping someone can point me in the right direction here.

推荐答案

I设法通过更多的试验和错误得到一些工作。  在我的v7代码中,我更改了我在stub.setHeader调用中使用的命名空间。  我最初使用

I managed to get something working through a bit more trial and error.  In my v7 code, I changed the namespace that I was using in the stub.setHeader calls.  I was initially using

" https://adcenter.microsoft.com/v7"

"https://adcenter.microsoft.com/v7"

(因为它已经在另一个v7代码示例我正在关注),而是使用 

(as it had been in the other v7 code sample I was following), and instead used 

" https://adcenter.microsoft.com/api/customermanagement"

一旦我这样做,我就不再收到有关无效凭据的错误,并且我对getAccountsInfo的调用成功了。  我不知道某些v7服务是否需要一个命名空间,有些期望另一个,或者如果查看的
的v7代码示例已过期,或者是什么。  我改编的v7代码示例位于http://msdn.microsoft.com/en-us/library/cc728898.aspx

As对于可能发现自己处于我的情况的其他人的另一个注释,我还使用了v7代码示例中的不同端点URL(除了简单地将其更改为引用CustomerManagement服务)。  我成功使用的端点网址
是 

https://sharedservices.adcenterapi.microsoft.com/Api/CustomerManagement/v7/CustomerManagementService。 svc?wsdl

https://sharedservices.adcenterapi.microsoft.com/Api/CustomerManagement/v7/CustomerManagementService.svc?wsdl

同样,我不知道微软是否改变了他们希望我们使用端点URL的方式,或者它是否取决于您使用的服务等。  理想情况下,可以提取更多最新的代码示例。

Again, I don't know if Microsoft has changed the way they'd like us to use endpoint URLs, or if it depends on which service you are using, etc.  Ideally there would be more up-to-date code samples to draw from.


这篇关于帮助调用CustomerManagementService.getAccounts / getAccountsInfo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆