使用ClientAccountNumber时,AddClientLinks API调用失败并出现内部错误 [英] AddClientLinks API call fails with internal error when ClientAccountNumber is used

查看:61
本文介绍了使用ClientAccountNumber时,AddClientLinks API调用失败并出现内部错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用AddClientLinks API调用来链接到客户端Bing帐户。但是,它失败并出现错误:"内部系统错误。查看SOAP故障详细信息以获取更多信息" (在"SOAP故障详细信息"中,实际上似乎没有
更多信息。如果我将API调用更改为使用ClientAccountId而不是ClientAccountNumber,则API调用可以正常工作.Bing广告API文档(https://msdn.microsoft.com/en-us/library/bing-ads-customer-management-clientlink(v=msads.90).aspx)
说:"添加客户端时链接,ClientAccountId或ClientAccountNumber是必需的,但同时指定这两个将导致操作失败。"因此,我不明白为什么AddClientLinks API调用在我发送ClientAccountNumber时失败,
但是当我成功时它成功发送ClientAccountId。这是失败的SOAP请求:



ID:20

  地址:https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v9/CustomerManagementService.svc

   ;编码:UTF-8

   Http-Meth od:POST

   内容类型:text / xml

   标题:{Accept = [* / *],SOAPAction = [" AddClientLinks"],User-Agent = [BingAdsSDKJava 10.4.13]}

   有效负载:

< soap:Envelope xmlns:soap =" http://schemas.xmlsoap.org/soap/envelope/">

  < SOAP-ENV:Header xmlns:SOAP-ENV =" http://schemas.xmlsoap.org/soap/envelope/">

  &NBSP; < AuthenticationToken xmlns =" https://guideads.microsoft.com/Customer/v9">

  &NBSP; &NBSP; Blah

  &NBSP; < / AuthenticationToken>

  &NBSP; < CustomerAccountId xmlns =" https://bingads.microsoft.com/Customer/v9"> -9223372036854775808< / CustomerAccountId>

  &NBSP; < CustomerId xmlns =" https://bingads.microsoft.com/Customer/v9"> ***< / CustomerId>

  &NBSP; < DeveloperToken xmlns =" https://guideads.microsoft.com/Customer/v9"> Blah< / DeveloperToken>

  < / SOAP-ENV:标题>

  < soap:Body>

  &NBSP; < AddClientLinksRequest xmlns =" https://bingads.microsoft.com/Customer/v9"

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;的xmlns:ns2的= QUOT; HTTPS://bingads.microsoft.com/Customer/v9/Entities" xmlns:ns3 =" https://adapi.microsoft.com"

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;   xmlns:ns4 =" https://bingads.microsoft.com/Customer/v9/Exception"

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;   xmlns:ns5 =" http://schemas.datacontract.org/2004/07/System.Collections.Generic"

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;   xmlns:ns6 =" http://schemas.microsoft.com/2003/10/Serialization/Arrays"

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;   xmlns:ns7 =" http://schemas.microsoft.com/2003/10/Serialization/">

  &NBSP; &NBSP; < ClientLinks>

  &NBSP; &NBSP; &NBSP; < ns2:ClientLink>

  &NBSP; &NBSP; &NBSP; &NBSP; < ns2:ClientAccountId xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi:nil =" true" />

  &NBSP; &NBSP; &NBSP; &NBSP; < ns2:ClientAccountNumber> ***< / ns2:ClientAccountNumber>

  &NBSP; &NBSP; &NBSP; &NBSP; < ns2:ManagingCustomerId> ***< / ns2:ManagingCustomerId>

  &NBSP; &NBSP; &NBSP; &NBSP; < ns2:ManagingCustomerNumber xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi:nil =" true" />

  &NBSP; &NBSP; &NBSP; &NBSP; < ns2:注意> Finch正在请求访问您的Bing帐户< / ns2:注意>

  &NBSP; &NBSP; &NBSP; &NBSP; < ns2:名称> Finch客户端链接< / ns2:名称>

  &NBSP; &NBSP; &NBSP; &NBSP; < ns2:InviterEmail> ***< / ns2:InviterEmail>

  &NBSP; &NBSP; &NBSP; &NBSP; < ns2:InviterName> Finch< / ns2:InviterName>

  &NBSP; &NBSP; &NBSP; &NBSP; < ns2:InviterPhone> ***< / ns2:InviterPhone>

  &NBSP; &NBSP; &NBSP; &NBSP; < ns2:IsBillToClient> true< / ns2:IsBillToClient>

  &NBSP; &NBSP; &NBSP; &NBSP; < ns2:StartDate xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi:nil =" true" />

  &NBSP; &NBSP; &NBSP; &NBSP; < ns2:Status xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi:nil =" true" />

  &NBSP; &NBSP; &NBSP; &NBSP; < ns2:Timestamp xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi:nil =" true" />

  &NBSP; &NBSP; &NBSP; &NBSP; < ns2:ForwardCompatibilityMap xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi:nil =" true" />

  &NBSP; &NBSP; &NBSP; < / ns2:ClientLink>

  &NBSP; &NBSP; < / ClientLinks>

  &NBSP; < / AddClientLinksRequest>

  < / soap:Body>

< / soap:Envelope>



以下是回复:


  &NBSP; --------------------------------------

  ; &NBSP; 2017-06-01 00:19:32.476  INFO --- [nio-8080-exec-5] o.a.c.s.C.I.ICustomerManagementService  :入境消息

  &NBSP; ----------------------------

  &NBSP; ID:20

  &NBSP;回复代码:500

  &NBSP;编码:UTF-8

  &NBSP; Content-Type:text / xml; charset = utf-8

  &NBSP;标题:{Cache-Control = [private],Content-Length = [720],content-type = [text / xml; charset = utf-8],日期= [星期四,2017年6月1日06:19:31 GMT],服务器= [Microsoft-IIS / 8.5],X-AspNet-Version = [4.0.30319],X-Powered-By = [ASP.NET]}

  &NBSP;有效负载:< s:信封xmlns:s =" http://schemas.xmlsoap.org/soap/envelope/">

< s:Body>

  < s:故障>

  &NBSP; < faultcode> s:客户< / faultcode>

  &NBSP; < faultstring xml:lang =" en-US">内部系统错误。有关详细信息,请查看SOAP故障详细信息< / faultstring>

  &NBSP; < detail>

  &NBSP; &NBSP; < ApiFault xmlns =" https://guideads.microsoft.com/Customer/v9" xmlns:a =" https://guideads.microsoft.com/Customer/v9/Exception"

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; xmlns:i =" http://www.w3.org/2001/XMLSchema-instance">

  &NBSP; &NBSP; &NBSP; < TrackingId xmlns =" https://adapi.microsoft.com"> eed5d0ac-1a4e-41db-8885-ce33178eebea< / TrackingId>

  &NBSP; &NBSP; &NBSP; < a:OperationErrors>

  &NBSP; &NBSP; &NBSP; &NBSP; < a:OperationError>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < a:代码> -1< / a:代码>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < a:详细信息/>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < a:消息>发生内部错误。< / a:消息>

  &NBSP; &NBSP; &NBSP; &NBSP; < / a:OperationError>

  &NBSP; &NBSP; &NBSP; < / a:OperationErrors>

  &NBSP; &NBSP; < / ApiFault>

  &NBSP; < / detail>

  < / s:故障>

< / s:Body>

< / s:Envelope>



我无法真正更改我的代码以使用ClientAccountId而不是ClientAccountNumber。为什么在使用ClientAccountNumber时完全相同的AddClientLinks API调用失败,但在使用ClientAccountId时成功?



感谢提前帮助,



Jon

解决方案

Hello。


我对开发环境以及如何构建SOAP感到好奇。虽然它可能没有关系,但客户管理API不提供CustomerId和CustomerAccountId标头,所以你可以在没有它们的情况下再试一次(或者至少
而没有负CustomerAccountId)?


<你有没有试过配对ClientAccountNumber + ManagingCustomerNumber? 


谢谢,


Eric

I am attempting to use the AddClientLinks API call to link to client Bing accounts. However, it is failing with the error: "Internal system error. Chack the SOAP fault details for more information" (there doesn't actually appear to be any more information in the "SOAP fault details". If I change the API call to use the ClientAccountId instead of ClientAccountNumber, then the API call works just fine. The Bing Ads API docs (https://msdn.microsoft.com/en-us/library/bing-ads-customer-management-clientlink(v=msads.90).aspx) say: "When adding a client link, either the ClientAccountId or ClientAccountNumber is required, but specifying both will cause the operation to fail." Therefore, I don't understand why the AddClientLinks API call fails when I send the ClientAccountNumber, but it succeeds when I send the ClientAccountId. Here is the SOAP request that is failing:

ID: 20
    Address: https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v9/CustomerManagementService.svc
    Encoding: UTF-8
    Http-Method: POST
    Content-Type: text/xml
    Headers: {Accept=[*/*], SOAPAction=["AddClientLinks"], User-Agent=[BingAdsSDKJava 10.4.13]}
    Payload:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <AuthenticationToken xmlns="https://bingads.microsoft.com/Customer/v9">
      Blah
    </AuthenticationToken>
    <CustomerAccountId xmlns="https://bingads.microsoft.com/Customer/v9">-9223372036854775808</CustomerAccountId>
    <CustomerId xmlns="https://bingads.microsoft.com/Customer/v9">***</CustomerId>
    <DeveloperToken xmlns="https://bingads.microsoft.com/Customer/v9">Blah</DeveloperToken>
  </SOAP-ENV:Header>
  <soap:Body>
    <AddClientLinksRequest xmlns="https://bingads.microsoft.com/Customer/v9"
                           xmlns:ns2="https://bingads.microsoft.com/Customer/v9/Entities" xmlns:ns3="https://adapi.microsoft.com"
                           xmlns:ns4="https://bingads.microsoft.com/Customer/v9/Exception"
                           xmlns:ns5="http://schemas.datacontract.org/2004/07/System.Collections.Generic"
                           xmlns:ns6="http://schemas.microsoft.com/2003/10/Serialization/Arrays"
                           xmlns:ns7="http://schemas.microsoft.com/2003/10/Serialization/">
      <ClientLinks>
        <ns2:ClientLink>
          <ns2:ClientAccountId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
          <ns2:ClientAccountNumber>***</ns2:ClientAccountNumber>
          <ns2:ManagingCustomerId>***</ns2:ManagingCustomerId>
          <ns2:ManagingCustomerNumber xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
          <ns2:Note>Finch is requesting access to your Bing account(s)</ns2:Note>
          <ns2:Name>Finch Client Link</ns2:Name>
          <ns2:InviterEmail>***</ns2:InviterEmail>
          <ns2:InviterName>Finch</ns2:InviterName>
          <ns2:InviterPhone>***</ns2:InviterPhone>
          <ns2:IsBillToClient>true</ns2:IsBillToClient>
          <ns2:StartDate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
          <ns2:Status xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
          <ns2:Timestamp xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
          <ns2:ForwardCompatibilityMap xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
        </ns2:ClientLink>
      </ClientLinks>
    </AddClientLinksRequest>
  </soap:Body>
</soap:Envelope>

Here is the response:

    --------------------------------------
    2017-06-01 00:19:32.476  INFO --- [nio-8080-exec-5] o.a.c.s.C.I.ICustomerManagementService   : Inbound Message
    ----------------------------
    ID: 20
    Response-Code: 500
    Encoding: UTF-8
    Content-Type: text/xml; charset=utf-8
    Headers: {Cache-Control=[private], Content-Length=[720], content-type=[text/xml; charset=utf-8], Date=[Thu, 01 Jun 2017 06:19:31 GMT], Server=[Microsoft-IIS/8.5], X-AspNet-Version=[4.0.30319], X-Powered-By=[ASP.NET]}
    Payload: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
  <s:Fault>
    <faultcode>s:Client</faultcode>
    <faultstring xml:lang="en-US">Internal system error. Check the SOAP fault details for more information</faultstring>
    <detail>
      <ApiFault xmlns="https://bingads.microsoft.com/Customer/v9" xmlns:a="https://bingads.microsoft.com/Customer/v9/Exception"
                xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <TrackingId xmlns="https://adapi.microsoft.com">eed5d0ac-1a4e-41db-8885-ce33178eebea</TrackingId>
        <a:OperationErrors>
          <a:OperationError>
            <a:Code>-1</a:Code>
            <a:Details/>
            <a:Message>An internal error has occurred.</a:Message>
          </a:OperationError>
        </a:OperationErrors>
      </ApiFault>
    </detail>
  </s:Fault>
</s:Body>
</s:Envelope>

I can't really change my code to use ClientAccountId instead of ClientAccountNumber. Why does the exact same AddClientLinks API call fail when using ClientAccountNumber but succeeds when using ClientAccountId?

Thanks in advance for your help,

Jon

解决方案

Hello.

I'm curious about the dev environment and how you are constructing the SOAP. While it might not be related, the CustomerId and CustomerAccountId headers are not available with Customer Management API, so can you please try again without them (or at least without negative CustomerAccountId)?

Have you tried to pair ClientAccountNumber + ManagingCustomerNumber? 

Thank you,

Eric


这篇关于使用ClientAccountNumber时,AddClientLinks API调用失败并出现内部错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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