Я пытаюсь вызвать бинговые объявления для отчетов об эффективности. Идея заключается в том, чтобы распечатать все ключевые показатели ключевых показателей ключевых слов. Должен ли я потребовать установить больше параметров в запросе? Я установил все параметры, описанные в документе bing.Недопустимые данные клиента в запросе BingAd
PasswordAuthentication passwordAuthentication
= new PasswordAuthentication(USER_NAME, PASSWORD);
authorizationData.setAuthentication(passwordAuthentication);
authorizationData.setCustomerId(customerId);
authorizationData.setAccountId(accountId);
authorizationData.setDeveloperToken(DEVELOPER_TOKEN);
ServiceClient<IAdInsightService> adInsightService = new ServiceClient<IAdInsightService>(
authorizationData,
IAdInsightService.class);
GetHistoricalKeywordPerformanceRequest getHistoricalKeywordPerformanceRequest = new GetHistoricalKeywordPerformanceRequest();
try {
GetHistoricalKeywordPerformanceResponse historicalKeywordPerformance = adInsightService.getService().getHistoricalKeywordPerformance(getHistoricalKeywordPerformanceRequest);
ArrayOfKeywordHistoricalPerformance keywordHistoricalPerformances = historicalKeywordPerformance.getKeywordHistoricalPerformances();
List<KeywordHistoricalPerformance> keywordHistoricalPerformances1 = keywordHistoricalPerformances.getKeywordHistoricalPerformances();
for (Iterator<KeywordHistoricalPerformance> iterator = keywordHistoricalPerformances1.iterator(); iterator.hasNext();) {
KeywordHistoricalPerformance performance = iterator.next();
ArrayOfKeywordKPI keywordKPIs = performance.getKeywordKPIs();
for (Iterator<KeywordKPI> iterator1 = keywordKPIs.getKeywordKPIs().iterator(); iterator1.hasNext();) {
KeywordKPI kPI = iterator1.next();
System.out.println("Impressions " + kPI.getImpressions());
}
}
} catch (Exception ex) {
}
При запуске его выбрасывается ниже исключения.
com.microsoft.bingads.v10.adinsight.ApiFaultDetail_Exception: Invalid client data. 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:422)
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.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:140)
at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:71)
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.$Proxy59.getHistoricalKeywordPerformance(Unknown Source)
at test.BingApi.main(BingApi.java:88)