none
Migrating from v8 to v10 - Sandbox Returning "An internal error has occurred." RRS feed

  • Question

  • Hi ~

    I'm trying to get all of some old code back up into working order & trying to just do a simple "list campaigns" against our sandbox account

    The initialization looks like:

    protected def campaignManagement: ICampaignManagementService = campaignManagementServiceClient.getService()

    protected def campaignManagementServiceClient: ServiceClient[ICampaignManagementService] = {
    val authorizationData = new AuthorizationData()
    authorizationData.setDeveloperToken(config.apiAccessKey)
    authorizationData.setAuthentication(new PasswordAuthentication(config.username, config.password))
    authorizationData.setCustomerId(config.customerId)
    authorizationData.setAccountId(account.id)

    new ServiceClient(authorizationData, classOf[ICampaignManagementService])
    }

    I verified I'm using the correct sandbox apiAccessKey (the generic one everyone uses), and the appropriate customerId/Account Id for the sandbox account & the username/passwords are accurate as I can log into the sandbox.bingads.microsoft.com ... in fact I was getting various invalid credential errors for a while until I fixed those.

    Now I'm not getting any more credential invalid exceptions - but a very un-useful internal error exception.  Here's the full stack-trace:

    $ ./adcenter.sh --sandbox --list
    10:47:55.094 [main] WARN  fm.common.Crypto - Key is too long (520 bits).  It is being truncated to 256
    Using SANDBOX environment
    Calling Service... 10:47:55.420 [main] INFO  o.a.c.w.s.f.ReflectionServiceFactoryBean - Creating Service {https://bingads.microsoft.com/CampaignManagement/v10}CampaignManagementService from class com.microsoft.bingads.v10.campaignmanagement.ICampaignManagementService
    10:47:56.854 [main] INFO  o.a.c.w.s.f.ReflectionServiceFactoryBean - Creating Service {https://bingads.microsoft.com/CampaignManagement/v10}CampaignManagementService from class com.microsoft.bingads.v10.campaignmanagement.ICampaignManagementService
    10:47:57.282 [main] WARN  o.a.c.t.h.HttpsURLConnectionFactory - Default key managers cannot be initialized: /Users/eric/.keystore (No such file or directory)
    ApiFaultDetail exception encountered.
    Tracking ID: 435ee4ab-b914-4e55-aadb-7f822b157155
    Operation error encountered:
    Message: An internal error has occurred.
    Detail: null
    ErrorCode: InternalError
    Code: 0
    Exception in thread "main" com.microsoft.bingads.v10.campaignmanagement.ApiFaultDetail_Exception: Internal system error. Check the SOAP fault details for more information
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at org.apache.cxf.interceptor.ClientFaultConverter.processFaultDetail(ClientFaultConverter.java:182)
    at org.apache.cxf.interceptor.ClientFaultConverter.handleMessage(ClientFaultConverter.java:82)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113)
    at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
    at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1638)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1527)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1330)
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
    at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:638)
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:138)
    at com.sun.proxy.$Proxy60.getCampaignsByAccountId(Unknown Source)
    at fm.sem.adcenter.api.Campaigns$$anonfun$1.apply(Campaigns.scala:36)
    at fm.sem.adcenter.api.Campaigns$$anonfun$1.apply(Campaigns.scala:36)
    at fm.sem.adcenter.api.AdCenterService$.callWithObjs(AdCenterService.scala:21)
    at fm.sem.adcenter.api.AdCenterService$.call(AdCenterService.scala:17)
    at fm.sem.adcenter.api.AdCenterService$$anonfun$call$1.apply(AdCenterService.scala:126)
    at fm.common.Service$.call0(Service.scala:156)
    at fm.common.Service$.call(Service.scala:130)
    at fm.sem.Service$class.call(Service.scala:26)
    at fm.sem.adcenter.api.CampaignManagementService.fm$sem$adcenter$api$AdCenterService$$super$call(CampaignManagementService.scala:13)
    at fm.sem.adcenter.api.AdCenterService$class.call(AdCenterService.scala:126)
    at fm.sem.adcenter.api.CampaignManagementService.call(CampaignManagementService.scala:13)
    at fm.sem.adcenter.api.Campaigns.getCampaignsByAccountId(Campaigns.scala:36)
    at fm.sem.adcenter.AdCenterApp$.listCampaigns(AdCenterApp.scala:33)
    at fm.sem.SemApp.main(SemApp.scala:57)
    at fm.sem.adcenter.AdCenterApp.main(AdCenterApp.scala)

    Any ideas would be welcome.

    Wednesday, December 16, 2015 7:03 PM

Answers

All replies

  • Do you have the SOAP request for GetCampaignsByAccountId available? (Credentials not needed, so please remove them before pasting in the forum.) Happy to take a closer look.

    Regards,
    Eric

    Wednesday, December 16, 2015 10:35 PM
    Owner
  • Here's the request:

    POST https://campaign.api.sandbox.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v10/CampaignManagementService.svc HTTP/1.1
    Content-Type: text/xml; charset=UTF-8
    Accept: */*
    SOAPAction: "GetCampaignsByAccountId"
    User-Agent: BingAdsSDKJava 9.3.4
    Cache-Control: no-cache
    Pragma: no-cache
    Host: campaign.api.sandbox.bingads.microsoft.com
    Connection: keep-alive
    Content-Length: 1311

    <?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
       <soap:Header>
          <CustomerAccountId xmlns="https://bingads.microsoft.com/CampaignManagement/v10">XXXXXX</CustomerAccountId>
          <CustomerId xmlns="https://bingads.microsoft.com/CampaignManagement/v10">YYYYYY</CustomerId>
          <DeveloperToken xmlns="https://bingads.microsoft.com/CampaignManagement/v10">BBD37VB98</DeveloperToken>
          <UserName xmlns="https://bingads.microsoft.com/CampaignManagement/v10">blahblahblah</UserName>
          <Password xmlns="https://bingads.microsoft.com/CampaignManagement/v10">blehblehbleh</Password>
       </soap:Header>
       <soap:Body>
          <GetCampaignsByAccountIdRequest xmlns="https://bingads.microsoft.com/CampaignManagement/v10" xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ns3="http://schemas.datacontract.org/2004/07/System.Collections.Generic" xmlns:ns4="https://adapi.microsoft.com" xmlns:ns5="http://schemas.datacontract.org/2004/07/System" xmlns:ns6="http://schemas.datacontract.org/2004/07/Microsoft.AdCenter.Advertiser.CampaignManagement.Api.DataContracts.V10" xmlns:ns7="http://schemas.microsoft.com/2003/10/Serialization/">
             <AccountId>4594983</AccountId>
             <CampaignType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
          </GetCampaignsByAccountIdRequest>
       </soap:Body>
    </soap:Envelope>

    Thursday, December 17, 2015 6:44 PM
  • Welp, I took a stab in the dark and added 

    request.setCampaignType(Seq(CampaignType.SEARCH_AND_CONTENT).asJava) - now it works (which previously wasn't in the v8 api)

    Thursday, December 17, 2015 6:50 PM
  • Yes CampaignType is required in V10. Glad you are unblocked!
    Friday, December 18, 2015 4:33 PM
    Owner