none
Adcenter API - sandbox returning 400

    Question

  • Hi guys, I am having problems submiting a report to the sandbox using SoapUI (soap only calls). It keeps giving me an internal service fault.

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
       <s:Body>
          <s:Fault>
             <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode>
             <faultstring xml:lang="en-US">The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the &lt;serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.</faultstring>
          </s:Fault>
       </s:Body>
    </s:Envelope>

    Here is the request: 

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v9="https://bingads.microsoft.com/Reporting/v9">
       <soapenv:Header>
           <v9:UserName>*******</v9:UserName>
          <v9:Password>*******</v9:Password>
          <v9:DeveloperToken>BBD37VB98</v9:DeveloperToken>
          <v9:CustomerId>*******</v9:CustomerId>
          <v9:CustomerAccountId>*******</v9:CustomerAccountId>
       </soapenv:Header>
       <soapenv:Body>
          <v9:SubmitGenerateReportRequest>
             <!--Optional:-->
             <v9:ReportRequest>
             </v9:ReportRequest>
          </v9:SubmitGenerateReportRequest>
       </soapenv:Body>
    </soapenv:Envelope>


    Monday, January 06, 2014 3:30 PM

All replies

  • Hello.

    Please keep in mind that soapUI will claim that most fields are 'Optional', even those which are required. For example you must define a valid type of ReportRequest. For more information please see the reference documentation for SubmitGenerateReport.

    I hope this helps!

    Monday, January 06, 2014 7:12 PM
    Moderator
  • Thanks Eric, I got past it. I am seeing something else now for some reason when I have XML that works against the sandbox account, but not with my production credentials.  Is there anywhere I can see the logs for this using the trackingid or is that for internal use only?

    Thanks!

    Blake

    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="https://adcenter.microsoft.com/v8" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns="https://adcenter.microsoft.com/v8" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <env:Header>
    <DeveloperToken>***************</DeveloperToken>
    <UserName>******************</UserName>
    <Password>**************</Password>
    <CustomerId>1935</CustomerId>
    <CustomerAccountId>1163</CustomerAccountId>
    </env:Header>
    <env:Body><SubmitGenerateReportRequest>
    <ReportRequest i:type="AccountPerformanceReportRequest">
    <Format>Xml</Format>
    <ReportName>myreportererere</ReportName>
    <Aggregation>Daily</Aggregation>
    <Columns><AccountPerformanceReportColumn>Impressions</AccountPerformanceReportColumn><AccountPerformanceReportColumn>Clicks</AccountPerformanceReportColumn><AccountPerformanceReportColumn>Ctr</AccountPerformanceReportColumn><AccountPerformanceReportColumn>AverageCpc</AccountPerformanceReportColumn><AccountPerformanceReportColumn>Spend</AccountPerformanceReportColumn><AccountPerformanceReportColumn>AveragePosition</AccountPerformanceReportColumn><AccountPerformanceReportColumn>AccountName</AccountPerformanceReportColumn><AccountPerformanceReportColumn>TimePeriod</AccountPerformanceReportColumn></Columns><Filter></Filter>
    <Scope>
    <AccountIds><a:long>1163</a:long></AccountIds>
    </Scope>
    <Time><ReportTimePeriod>LastYear</ReportTimePeriod></Time>
    </ReportRequest></SubmitGenerateReportRequest>
    </env:Body>
    </env:Envelope>

    Here is the return XML 

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
       <s:Body>
          <s:Fault>
             <faultcode>s:Server</faultcode>
             <faultstring xml:lang="en-US">Invalid client data. Check the SOAP fault details for more information</faultstring>
             <detail>
                <AdApiFaultDetail xmlns="https://adapi.microsoft.com" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                   <TrackingId>16628078-36c0-4bdb-8ca7-fc78dcba0428</TrackingId>
                   <Errors>
                      <AdApiError>
                         <Code>105</Code>
                         <Detail i:nil="true"/>
                         <ErrorCode>InvalidCredentials</ErrorCode>
                         <Message>Authentication failed. Either supplied credentials are invalid or the account is inactive</Message>
                      </AdApiError>
                   </Errors>
                </AdApiFaultDetail>
             </detail>
          </s:Fault>
       </s:Body>
    </s:Envelope>

    Wednesday, January 08, 2014 2:20 AM
  • Hello.

    Be sure to change the CustomerId, CustomerAccountId, and AccountId to use production identifiers. Also the SOAP for Time should appear as follows:

    <Time><PredefinedTime>LastYear</PredefinedTime></Time>

    Regards,

    Eric

    Wednesday, January 08, 2014 2:41 AM
    Moderator
  • Hi Eric,

    Thanks for the feedback.

    It is the correct API key (one sent in the email), I can log into the account with the username and password, and I pulled the CID, AID out of the query string.

    This query does run against the sandbox just fine.  I can post the XML from there if it might give a clue.

    Ill be looking at it some later today.


    Wednesday, January 08, 2014 2:19 PM
  • I have compared the sandbox against the production CID, and AID, got them from the same place. Double checked developer token username. No luck. Same code works perfectly against the sandbox I can download the report.

    SANDBOX - WORKS DOWNLOADED REPORT - SEE PRODUCTION XML AT BOTTOM

    D, [2014-01-08T10:48:57.292292 #43718] DEBUG -- : SOAP request: https://api.sandbox.bingads.microsoft.com/Api/Advertiser/V8/Reporting/ReportingService.svc
    D, [2014-01-08T10:48:57.292382 #43718] DEBUG -- : SOAPAction: SubmitGenerateReport, Content-Type: text/xml;charset=UTF-8, Content-Length: 1620
    D, [2014-01-08T10:48:57.292418 #43718] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?>
                                                      <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="https://adcenter.microsoft.com/v8" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns="https://adcenter.microsoft.com/v8" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
                                                      <env:Header><DeveloperToken>BBD37VB98</DeveloperToken><UserName>*********</UserName><Password>********</Password><CustomerId>21022352</CustomerId><CustomerAccountId>7071701</CustomerAccountId></env:Header>
                                                      <env:Body>
                                                      <SubmitGenerateReportRequest>
                                                      <ReportRequest i:type="AccountPerformanceReportRequest">
                                                      <Format>Xml</Format>
                                                      <ReportName>myreportererere</ReportName>
                                                      <Aggregation>Daily</Aggregation>
                                                      <Columns>
                                                      <AccountPerformanceReportColumn>Impressions</AccountPerformanceReportColumn>
                                                      <AccountPerformanceReportColumn>Clicks</AccountPerformanceReportColumn>
                                                      <AccountPerformanceReportColumn>Ctr</AccountPerformanceReportColumn>
                                                      <AccountPerformanceReportColumn>AverageCpc</AccountPerformanceReportColumn>
                                                      <AccountPerformanceReportColumn>Spend</AccountPerformanceReportColumn>
                                                      <AccountPerformanceReportColumn>AveragePosition</AccountPerformanceReportColumn>
                                                      <AccountPerformanceReportColumn>AccountName</AccountPerformanceReportColumn>
                                                      <AccountPerformanceReportColumn>TimePeriod</AccountPerformanceReportColumn>
                                                      </Columns>
                                                      <Filter></Filter>
                                                      <Scope><AccountIds><a:long>7071701</a:long></AccountIds></Scope>
                                                      <Time><PredefinedTime>LastYear</PredefinedTime></Time></ReportRequest>
                                                      </SubmitGenerateReportRequest>
                                                      </env:Body>
                                                      </env:Envelope>
    D, [2014-01-08T10:48:58.142450 #43718] DEBUG -- : SOAP response (status 200):
    D, [2014-01-08T10:48:58.142527 #43718] DEBUG -- : <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
                                                      <s:Header><h:TrackingId xmlns:h="https://adcenter.microsoft.com/v8">0c4ff451-f234-4074-95e0-10f966e10207</h:TrackingId></s:Header>
                                                      <s:Body><SubmitGenerateReportResponse xmlns="https://adcenter.microsoft.com/v8"><ReportRequestId>18904440</ReportRequestId></SubmitGenerateReportResponse></s:Body>
                                                      </s:Envelope>
    D, [2014-01-08T10:48:58.791787 #43718] DEBUG -- : SOAP request: https://api.sandbox.bingads.microsoft.com/Api/Advertiser/V8/Reporting/ReportingService.svc
    D, [2014-01-08T10:48:58.791870 #43718] DEBUG -- : SOAPAction: PollGenerateReport, Content-Type: text/xml;charset=UTF-8, Content-Length: 630
    D, [2014-01-08T10:48:58.791901 #43718] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="https://adcenter.microsoft.com/v8" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns="https://adcenter.microsoft.com/v8"><env:Header><DeveloperToken>BBD37VB98</DeveloperToken><UserName>phpguy</UserName><Password>star1234</Password><CustomerId>21022352</CustomerId><CustomerAccountId>7071701</CustomerAccountId></env:Header><env:Body><PollGenerateReportRequest><ReportRequestId>18904440</ReportRequestId></PollGenerateReportRequest></env:Body></env:Envelope>
    D, [2014-01-08T10:48:59.652431 #43718] DEBUG -- : SOAP response (status 200):
    D, [2014-01-08T10:48:59.652513 #43718] DEBUG -- : <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Header><h:TrackingId xmlns:h="https://adcenter.microsoft.com/v8">16a3ea58-723a-443c-a33a-fb94bdba8839</h:TrackingId></s:Header><s:Body><PollGenerateReportResponse xmlns="https://adcenter.microsoft.com/v8"><ReportRequestStatus xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><ReportDownloadUrl>https://download.api.si.bingads.microsoft.com/ReportDownload/Download.aspx?q=ohY4luQauhRNX%2fiKF7yeGcVQsDV33eSsKR87zuY0Wu7HTfVPN7qnSS7pfpts%2bU0Ll3XCBQ9R%2b5zxe%2fgdb%2fEEPQuUmOBQTwsdeb%2fPSHccgCKXJJ7aVcwzuNrHrMs66bR3%2fUd6tc9%2bKSaOTFYwx%2f2n7CfLXW%2b4aX8boTi96mPO4VaZRnDDZhEALiufL5KqvZ7HLGYJEIZewm%2f1CaMKh8hyFb0HtEPN0KMjU5DtYGSidQAnPHWtxz3WNq0seHGyRhPs7AKPLf%2fO%2bACZT1xrlkSIqTupsVMH9F5JS6rivR2ExB5C</ReportDownloadUrl><Status>Success</Status></ReportRequestStatus></PollGenerateReportResponse></s:Body></s:Envelope>




    PRODUCTION -changing nothing but credentials and URL

    D, [2014-01-08T12:19:19.556724 #44124] DEBUG -- : SOAP request: https://api.bingads.microsoft.com/Api/Advertiser/V8/Reporting/ReportingService.svc
    D, [2014-01-08T12:19:19.556808 #44124] DEBUG -- : SOAPAction: SubmitGenerateReport, Content-Type: text/xml;charset=UTF-8, Content-Length: 1634
    D, [2014-01-08T12:19:19.556842 #44124] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="https://adcenter.microsoft.com/v8" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns="https://adcenter.microsoft.com/v8" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><env:Header><DeveloperToken>******</DeveloperToken><UserName>********</UserName><Password>************</Password><CustomerId>1935</CustomerId><CustomerAccountId>1163</CustomerAccountId></env:Header><env:Body><SubmitGenerateReportRequest><ReportRequest i:type="AccountPerformanceReportRequest"><Format>Xml</Format><ReportName>myreportererere</ReportName><Aggregation>Daily</Aggregation><Columns><AccountPerformanceReportColumn>Impressions</AccountPerformanceReportColumn><AccountPerformanceReportColumn>Clicks</AccountPerformanceReportColumn><AccountPerformanceReportColumn>Ctr</AccountPerformanceReportColumn><AccountPerformanceReportColumn>AverageCpc</AccountPerformanceReportColumn><AccountPerformanceReportColumn>Spend</AccountPerformanceReportColumn><AccountPerformanceReportColumn>AveragePosition</AccountPerformanceReportColumn><AccountPerformanceReportColumn>AccountName</AccountPerformanceReportColumn><AccountPerformanceReportColumn>TimePeriod</AccountPerformanceReportColumn></Columns><Filter></Filter><Scope><AccountIds><a:long>1163</a:long></AccountIds></Scope><Time><PredefinedTime>LastYear</PredefinedTime></Time></ReportRequest></SubmitGenerateReportRequest></env:Body></env:Envelope>
    D, [2014-01-08T12:19:21.272649 #44124] DEBUG -- : SOAP response (status 500):
    D, [2014-01-08T12:19:21.272775 #44124] DEBUG -- : <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Server</faultcode><faultstring xml:lang="en-US">Invalid client data. Check the SOAP fault details for more information</faultstring><detail><AdApiFaultDetail xmlns="https://adapi.microsoft.com" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><TrackingId>5037ae0d-c7e7-4391-acda-0e5b6eddb472</TrackingId><Errors><AdApiError><Code>105</Code><Detail i:nil="true"/><ErrorCode>InvalidCredentials</ErrorCode><Message>Authentication failed. Either supplied credentials are invalid or the account is inactive</Message></AdApiError></Errors></AdApiFaultDetail></detail></s:Fault></s:Body></s:Envelope>

    Wednesday, January 08, 2014 6:23 PM
  • I recommend that you escalate with the same information, and also your production UserName + DeveloperToken to support. That's the most efficient way to troubleshoot this type of error.

    http://msdn.microsoft.com/en-US/library/aa983155.aspx#engagesupport

    Best regards,

    Eric

    Thursday, January 09, 2014 12:08 AM
    Moderator