Giter Site home page Giter Site logo

bingads-java-sdk's Introduction

Bing Ads Java SDK

Note

For optimal compatibility and performance, please ensure you're using Java version 8 or higher. Verify your current version using java -version.
Use examples/pom_for_java1.8.xml for Java 8 and examples/pom.xml for Java 11 or higher

You can develop Bing Ads applications with any programming language that supports web services. The Bing Ads Java Software Development Kit (SDK) enhances the experience of developing Bing Ads applications with Java. The SDK includes a proxy to all Bing Ads API web services and abstracts low level details of authentication with OAuth. You can use the high level BulkServiceManager and ReportingServiceManager interfaces to abstract and execute operations in the low level Bulk and Reporting services. For example instead of calling SubmitGenerateReport and PollGenerateReport to download a report, you download a report using one method with the ReportingServiceManager class. For more information, see Bing Ads Client Libraries.

Getting Started

To get started developing Bing Ads applications with Java, install the SDK and either start with the examples or follow one of the application walkthroughs. For more information, see Getting Started Using Java with Bing Ads Services.

Maven Artifact

The Bing Ads Java SDK includes and depends on the microsoft.bingads Maven artifact. You must include the following dependency to your Maven project.

<dependency>
  <groupId>com.microsoft.bingads</groupId>
  <artifactId>microsoft.bingads</artifactId>
  <version>13.0.20.2</version>
</dependency>

If you are not using a Maven project, you must include the correct version of each dependency. You can review the complete list of Bing Ads Java SDK dependencies at the Maven Repository.

bingads-java-sdk's People

Contributors

dennis-yemelyanov avatar dependabot[bot] avatar eric-urban avatar estifisher avatar freiz avatar git-liubao avatar jianyunzhao avatar jinzhoms avatar lashchenko avatar lr47h avatar qitia avatar rgaritta avatar shytnt avatar xinyuwen2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bingads-java-sdk's Issues

refreshTokensIfNeeded does not timeout or retry if bing server does not answer

Today we found one of our application hung for more than an hour, after requesting a thread dump it was waiting for a refresh of the bing token (another was previously retrieved). You can check the stack-trace below.

   java.lang.Thread.State: RUNNABLE
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
	at java.net.SocketInputStream.read(SocketInputStream.java:171)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
	at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:593)
	at sun.security.ssl.InputRecord.read(InputRecord.java:529)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
	- locked <0x00000006f3f5aa10> (a java.lang.Object)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
	- locked <0x00000006f3f5aa28> (a java.lang.Object)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
	at org.apache.http.conn.ssl.SSLSocketFactory.createLayeredSocket(SSLSocketFactory.java:573)
	at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:557)
	at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:414)
	at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
	at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
	at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
	at com.microsoft.bingads.internal.HttpClientWebServiceCaller.post(HttpClientWebServiceCaller.java:31)
	at com.microsoft.bingads.internal.UriOAuthService.getAccessTokens(UriOAuthService.java:66)
	at com.microsoft.bingads.internal.OAuthWithAuthorizationCode.requestAccessAndRefreshTokens(OAuthWithAuthorizationCode.java:134)
	at com.microsoft.bingads.internal.OAuthWithAuthorizationCode.refreshTokensIfNeeded(OAuthWithAuthorizationCode.java:166)

Analyzing OAuthWithAuthorizationCode it can be seen that it doesn't set a timeout for the request, which could be a possible solution for this issue.

Type of TextAsset is missing

I am trying to create RSAs but the headlines and descriptions are not written to the bulk csv. I found that the type of TextAsset won't be automatically set to "TextAsset". So StringExtensions.toTextAssetLinksBulkString does not extract them and they are not written to the csv. Maybe StringExtensions.toTextAssetLinksBulkString should use "instanceof TextAsset" instead of checking type to be "TextAsset"?

some questions

/**
 * Reads the next csv row values, creates a new instance of the object and
 * populates it with the row values
 *
 * @returns>Next {@link BulkObject}
 */
@Override
public BulkObject readNextBulkObject() {
    this.initializeHeadersIfNeeded(); //# is this really need to be called at every retrieval?

    if (!objectIterator.hasNext()) {
        return null;
    }

    String[] fields = objectIterator.next();

    RowValues values = new RowValues(fields, columnMapping);
    BulkObject obj = bulkObjectFactory.createBulkObject(values);
    obj.readFromRowValues(values);//#why not combine the call with above?

    return obj;
}

v11 / KeywordPerformanceReport - Invalid Client Data

Hi there,

I try to retrieve Keyword Performance Report from our Sandbox Account.

Following exception is raised
com.microsoft.bingads.v11.reporting.AdApiFaultDetail_Exception: Invalid client data.

Executed code is exactly the same as the following example.

As mentioned on the example there is 3 options to retrieve the report (A,B,C). In my case A & B return null (i.e. no file, no exception) and C raises the exception above.

Any help or suggestion would be greatly appreciated.

Missing timeout on auth socket reading makes thread hang forever

Hello,

For our Bing reporting, we started observing thread pool exhaustion lately over seemingly busy threads. A thread dump shows the following:

"pool-3-thread-1" #16 prio=5 os_prio=0 tid=0x00007f089547b800 nid=0x4a00 runnable [0x00007f087c6d0000]
   java.lang.Thread.State: RUNNABLE
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
	at java.net.SocketInputStream.read(SocketInputStream.java:171)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
	at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:593)
	at sun.security.ssl.InputRecord.read(InputRecord.java:532)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
	- locked <0x00000000d3a4e3e0> (a java.lang.Object)
	at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:940)
	at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
	- locked <0x00000000d3a4e4a0> (a sun.security.ssl.AppInputStream)
	at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:158)
	at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:82)
	at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:271)
	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:140)
	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
	at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
	at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281)
	at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:259)
	at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:209)
	at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:686)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:488)
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:884)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
	at com.microsoft.bingads.internal.HttpClientWebServiceCaller.post(HttpClientWebServiceCaller.java:31)
	at com.microsoft.bingads.internal.UriOAuthService.getAccessTokens(UriOAuthService.java:90)
	at com.microsoft.bingads.internal.OAuthWithAuthorizationCode.requestAccessAndRefreshTokens(OAuthWithAuthorizationCode.java:144)
	at ...createAuthorizationData(BingUser.java:97)

Our logs, and also this issue give the impression that it is mostly an issue for the auth request step.

Allowing the user to (optionally) set timeouts for this kind of network operations would help us looking for SocketTimeoutExceptions or similar, thus allowing the recycling of the thread for a next attempt. We haven't discovered such an option in the Bing Ads SDK.

In some rare cases, we received a java.net.SocketException: Connection reset but this is not a behavior to rely on, obviously.

Thank you!
Marcel

Bing Ads Java requires CXF but does not fail if used with JAXWS-RI

We are developing a tool which uses AdWords and Bing Ads API. Both libs provide a JAXWS implementation. AdWords provides JAXWS-RI and Bing Ads provides CXF. So if not managed manually, that leads to an unpredictable behavior which runtime gets used, because the first one in the classpath will be used.

At least the reporting queries always fail with "100, NullRequest, The request message is null", if JAXWS-RI is used as JAXWS implementation.

So it would be nice, if a) Bing Ads API works with JAXWS-RI too or b) Bing Ads fails if the JAXWS implementation is not CXF.

Furthermore it would be nice, if a more recent version of CXF (at least 3.3.8, or 3.4.1 if possible) would be used.
For jakarta.jws-api version 2.1.0 would be nice, to not provoke version conflicts with AdWords.

SoapAction cached when making multiple different api calls from the same ServiceObject

I am not sure if this is a limitation of the WebService framework, or not, so feel free to close this bug if it is not relevant.

When I reuse the same ICampaignManagementService for multiple different api calls, I get an exception. Our workaround was to create a new Service object for every different type of api call.

It appears that the SOAPAction is not changed for the second call in this code. This is the relevant code snippet, I can provide source, I was just not sure if you wanted a pull request by Email?

        ICampaignManagementService campaignManagement = getCampaignManagementService();
        campaignManagement.getCampaignsByAccountId(getCampaignsByAccountIdRequest);
        campaignManagement.getAdExtensionsAssociations(getCampaignRequest);

The second call will have the following headers, Note GetCampaignsByAccountId in the header, but GetAdExtensionsAssociationsRequest in the soap body.

Http-Method: POST
Content-Type: text/xml
Headers: {Accept=[*/*], SOAPAction=["GetCampaignsByAccountId"], User-Agent=[BingAdsSDKJava 11.5.3]}

With this request body.

        <ns2:GetAdExtensionsAssociationsRequest
            xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"
            xmlns:ns2="https://bingads.microsoft.com/CampaignManagement/v10"
            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/Microsoft.AdCenter.Advertiser.CampaignManagement.Api.DataContracts.V10"
            xmlns:ns6="http://schemas.datacontract.org/2004/07/System"
            xmlns:ns7="http://schemas.microsoft.com/2003/10/Serialization/">
            <ns2:AccountId>XXXXXXX</ns2:AccountId>
            <ns2:AdExtensionType>Sitelink2AdExtension SiteLinksAdExtension</ns2:AdExtensionType>
            <ns2:AssociationType>Account</ns2:AssociationType>
            <ns2:EntityIds
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
                <ns2:ReturnAdditionalFields
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
                </ns2:GetAdExtensionsAssociationsRequest>
            </soap:Body>

And I get this error response

ID: 2
Response-Code: 500
Encoding: UTF-8
Content-Type: text/xml; charset=utf-8
Headers: {Cache-Control=[private], Content-Length=[3132], content-type=[text/xml; charset=utf-8], Date=[Wed, 06 Sep 2017 21:25:31 GMT], Server=[Microsoft-IIS/8.5], X-AspNet-Version=[4.0.30319], X-Powered-By=[ASP.NET]}
<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">Error in deserializing body of request message for operation 'GetCampaignsByAccountId'. OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'GetCampaignsByAccountIdRequest' and namespace 'https://bingads.microsoft.com/CampaignManagement/v10'. Found node type 'Element' with name 'ns2:GetAdExtensionsAssociationsRequest' and namespace 'https://bingads.microsoft.com/CampaignManagement/v10'</faultstring>
            <detail>
                <ExceptionDetail
                    xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel"
                    xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                    <HelpLink i:nil="true"/>
                    <InnerException>
                        <HelpLink i:nil="true"/>
                        <InnerException i:nil="true"/>
                        <Message>OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'GetCampaignsByAccountIdRequest' and namespace 'https://bingads.microsoft.com/CampaignManagement/v10'. Found node type 'Element' with name 'ns2:GetAdExtensionsAssociationsRequest' and namespace 'https://bingads.microsoft.com/CampaignManagement/v10'</Message>
                        <StackTrace>   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)&#xD;
   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)&#xD;
   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters)</StackTrace>
                        <Type>System.Runtime.Serialization.SerializationException</Type>
                    </InnerException>
                    <Message>Error in deserializing body of request message for operation 'GetCampaignsByAccountId'. OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'GetCampaignsByAccountIdRequest' and namespace 'https://bingads.microsoft.com/CampaignManagement/v10'. Found node type 'Element' with name 'ns2:GetAdExtensionsAssociationsRequest' and namespace 'https://bingads.microsoft.com/CampaignManagement/v10'</Message>
                    <StackTrace>   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters)&#xD;
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
                    <Type>System.ServiceModel.CommunicationException</Type>
                </ExceptionDetail>
            </detail>
        </s:Fault>
    </s:Body>
</s:Envelope>```

some compile errors encountered

not sure how this was possible:

renamed:    src/main/java/com/microsoft/bingads/internal/functionalInterfaces/BiConsumer.java -> src/main/java/com/microsoft/bingads/internal/functionalinterfaces/BiConsumer.java
renamed:    src/main/java/com/microsoft/bingads/internal/functionalInterfaces/BiFunction.java -> src/main/java/com/microsoft/bingads/internal/functionalinterfaces/BiFunction.java
renamed:    src/main/java/com/microsoft/bingads/internal/functionalInterfaces/Consumer.java -> src/main/java/com/microsoft/bingads/internal/functionalinterfaces/Consumer.java
renamed:    src/main/java/com/microsoft/bingads/internal/functionalInterfaces/Function.java -> src/main/java/com/microsoft/bingads/internal/functionalinterfaces/Function.java
renamed:    src/main/java/com/microsoft/bingads/internal/functionalInterfaces/Predicate.java -> src/main/java/com/microsoft/bingads/internal/functionalinterfaces/Predicate.java
renamed:    src/main/java/com/microsoft/bingads/internal/functionalInterfaces/Supplier.java -> src/main/java/com/microsoft/bingads/internal/functionalinterfaces/Supplier.java
renamed:    src/main/java/com/microsoft/bingads/internal/functionalInterfaces/TriConsumer.java -> src/main/java/com/microsoft/bingads/internal/functionalinterfaces/TriConsumer.java

diff --git a/src/test/java/com/microsoft/bingads/api/test/entities/targets/campaign/bids/daytime/BulkCampaignDayTimeTargetBidTest.java b/src/test/java/com/microsoft/bingads/api/test/entities/targindex bcd9379..ba7f9a1 100644
--- a/src/test/java/com/microsoft/bingads/api/test/entities/targets/campaign/bids/daytime/BulkCampaignDayTimeTargetBidTest.java
+++ b/src/test/java/com/microsoft/bingads/api/test/entities/targets/campaign/bids/daytime/BulkCampaignDayTimeTargetBidTest.java
@@ -1,4 +1,6 @@
-package com.microsoft.bingads.api.test.entities.target.campaign.bids.daytime;
+package com.microsoft.bingads.api.test.entities.targets.campaign.bids.daytime;

dependency updates in 13.0.8 make bingads-api unusable for me

I'm using openjdk 11 and have com.google.api-ads:adwords-axis as a dependency in my project. I depend on bingAds and googleAds to work together. Up to now it's was not easy to make all these concurrent version work together.
I had to exclude jakarta.mail:jakarta.mail-api, because it depends on com.sun.mail.util.PropUtil that doesn't exist in openjdk and I had to exclude com.monitorjbl:xlsx-streamer because it's xerces implementation collides with axis' requirements.

The problems I have now are:

  1. updating CXF dependency version from 3.3.2 to 3.4.2. removed javax.xml.ws:jaxws-api from dependencies (these classes are used by com.microsoft.bingads.ServiceClient amongst others). No big deal, the dependency can be added manually

  2. updating jakarta.jws-api version from 1.1.1 to 3.0.0. This is a big problem. They changed the package from javax.jws to jakarta.jws, so javax.jws.WebService used in com.microsoft.bingads.internal.ServiceFactoryImpl doesn't exist anymore. Besides: this package is used by adwords-axis too in version 1.1.1 - this update not only breaks bingAds but googleAds too. Even if I provide the original package-format using another artifact (javax.jws:javax.jws-api), I still get the exception

Caused by: javax.xml.soap.SOAPException: Unable to create message factory for SOAP: Unable to create SAAJ meta-factory: Provider com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl not found
        at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:90)
        at org.apache.cxf.binding.soap.saaj.SAAJFactoryResolver.createMessageFactory(SAAJFactoryResolver.java:56)
        at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor.getFactory(SAAJOutInterceptor.java:87)
        at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor.handleMessage(SAAJOutInterceptor.java:123)

and I don't know how to create a workaround for this issue.

Long story short: I don't know if it's possible to use 13.0.8 at all, at least for openjdk I'm not able to use it.

Add the ability to work behind a Web Proxy

Hi,
I have a problem to Invoke API calls when my client sets behind a Web Proxy
I already add a Fork to the SDK that add this ability using system properties

Please review and update if there is an exist option to do that

Thanks,
Yosef

Use parameterized types.

Why do types like ArrayOfKeywordPerformanceReportColumn exist? Couldn't that be ArrayOfReportColumn or just List?

How to execute the API behind a proxy?

Hey guys,

I am new to the Bing SDK. I am unclear on how to reach use the SDK behind a proxy?

I have tried placing these values. But it still throws me a connection timeout for the URL
https://dvsrdl.api.bingads.microsoft.com...

System.setProperty("web.proxy.enabled", "true");
System.setProperty("https.proxyHost", "<proxy-host>");
System.setProperty("https.proxyPort", "3128");

This is the code snippet that tries to download the report.

.... 
mSession = new ReportingServiceManager(authorizationData);			
mSession.setStatusPollIntervalInMilliseconds(1000);			
mSession.getAuthorizationData().validate();
.....
.....
mSession.downloadFileAsync(reportingDownloadParameters, null).get(TimeoutInMilliseconds,
					TimeUnit.MILLISECONDS);
 ...

I am using Bing SDK version - v12. and the latest Release mvn version.

and I am unclear on how the HTTPRequest library would accept my proxy to make the call.
Any ideas or hints would be greatly appreciated?

v11 Reporting service : ServiceConstructionException

Hi there,
We've noticed that the following exception is raised when we deploy on our servers:

39652 [main] INFO org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - Creating Service {https://bingads.microsoft.com/Reporting/v11}ReportingService from class com.microsoft.bingads.v11.reporting.IReportingService
[16/11/2017 14:28:19] [DBID: 1] [AdsEngine FATAL] javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Could not resolve a binding for null 

This exception is not raised and everything is ok on local. (Same account, credentials, ApiEnvironment.PRODUCTION).
Any suggestions?

Unable to download specific account's report

I am managing multiple accounts under a single developer token. When I download campaignperformancereport or keywordperformancereport it downloads the report for all the accounts I manage. There is no option to filter specific accounts.

Could not send Message.

We are making calls to the Bind Ad API - "Bing Ads API v11" (KeywordPerformanceReport + ProductSearchQueryPerformanceReport)

We are now getting the following error:

javax.xml.ws.WebServiceException: Could not send Message. at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:149) at com.sun.proxy.$Proxy282.submitGenerateReport(Unknown Source) at com.impact.cis.impl.bing.downloader.ReportDownloader.submitReportRequest(ReportDownloader.java:243) at com.impact.cis.impl.bing.downloader.ReportDownloader.downloadReportAsString(ReportDownloader.java:93) at com.impact.cis.impl.bing.downloader.ReportDownloader.downloadCostData(ReportDownloader.java:138) at com.impact.cis.impl.bing.downloader.ReportDownloader.downloadCostData(ReportDownloader.java:151) at com.impact.cis.impl.bing.downloader.ReportDownloader$DownloadMultipleConsumer.accept(ReportDownloader.java:82) at com.impact.cis.impl.bing.downloader.ReportDownloader$DownloadMultipleConsumer.accept(ReportDownloader.java:64) at java.util.ArrayList.forEach(ArrayList.java:1249) at com.impact.cis.impl.bing.downloader.ReportDownloader.download(ReportDownloader.java:168) at com.impact.cis.impl.bing.BingAdImporter.extract(BingAdImporter.java:76) at com.impact.cis.impl.bing.BingAdImporter.extract(BingAdImporter.java:35) at com.impact.cis.common.Importer.processExtraction(Importer.java:283) at com.impact.cis.common.Importer.execute(Importer.java:114) at com.impact.cis.JmsQueueListener.processCostImportAccount(JmsQueueListener.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:180) at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:112) at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:104) at org.springframework.jms.listener.adapter.MessagingMessageListenerAdapter.onMessage(MessagingMessageListenerAdapter.java:69) at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:719) at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:679) at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:649) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:317) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1166) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1158) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1055) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '503: Service Unavailable' when communicating with https://reporting.api.bingads.microsoft.com/Api/Advertiser/Reporting/v12/ReportingService.svc at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.doProcessResponseCode(HTTPConduit.java:1611) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1618) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1559) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1356) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:653) 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:520) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:429) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:283) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:138) ... 31 more

ClassCastExceptions in BulkServiceManager

Hi,

I'm using microsoft-bingads-13.0.2.jar
Since today around 8:00 CET I'm experiencing ClassCastExceptions in BulkServiceManager.

Main reason seem to be some network problems. But these shouldn't result in a ClassCastExceptions. Here two example stacks:

java.lang.ClassCastException: class java.net.SocketTimeoutException cannot be cast to class com.microsoft.bingads.v13.bulk.ApiFaultDetail_Exception (java.net.SocketTimeoutException is in module java.base of loader 'bootstrap'; com.microsoft.bingads.v13.bulk.ApiFaultDetail_Exception is in unnamed module of loader 'app')
	at com.microsoft.bingads.v13.bulk.BulkServiceManager$1.handleResponse(BulkServiceManager.java:234)
	at org.apache.cxf.jaxws.JaxwsClientCallback.handleException(JaxwsClientCallback.java:87)
	at org.apache.cxf.interceptor.ClientOutFaultObserver.onMessage(ClientOutFaultObserver.java:60)
	at org.apache.cxf.endpoint.ClientImpl$2.onMessage(ClientImpl.java:522)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1201)
	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:412)

and

java.lang.ClassCastException: class org.apache.cxf.binding.soap.SoapFault cannot be cast to class com.microsoft.bingads.v13.bulk.ApiFaultDetail_Exception (org.apache.cxf.binding.soap.SoapFault and com.microsoft.bingads.v13.bulk.ApiFaultDetail_Exception are in unnamed module of loader 'app')
	at com.microsoft.bingads.v13.bulk.BulkServiceManager$1.handleResponse(BulkServiceManager.java:234)
	at org.apache.cxf.jaxws.JaxwsClientCallback.handleException(JaxwsClientCallback.java:87)
	at org.apache.cxf.interceptor.ClientOutFaultObserver.onMessage(ClientOutFaultObserver.java:60)
	at org.apache.cxf.endpoint.ClientImpl$2.onMessage(ClientImpl.java:522)
	at org.apache.cxf.phase.PhaseInterceptorChain.wrapExceptionAsFault(PhaseInterceptorChain.java:374)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:332)
	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:531)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:433)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:411)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invokeAsync(JaxWsClientProxy.java:325)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:138)
	at org.apache.cxf.jaxws.JaxWsClientProxy.mapException(JaxWsClientProxy.java:195)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:145)
	at com.sun.proxy.$Proxy94.uploadEntityRecordsAsync(Unknown Source)
	at com.microsoft.bingads.v13.bulk.BulkServiceManager.uploadEntityRecordsImpl(BulkServiceManager.java:197)
	at com.microsoft.bingads.v13.bulk.BulkServiceManager.uploadEntitiesAsync(BulkServiceManager.java:182)

the source code around the line where this happens looks like this:

                    } catch (Exception ex) {
                        Throwable cause = ex.getCause();
                        String errorCode = "";
                        try {
-->                            errorCode = ((ApiFaultDetail_Exception) cause).getFaultInfo().getOperationErrors().getOperationErrors().get(0).getErrorCode();

A Exception is caught and then casted to ApiFaultDetail_Exception...

Security vulnerabilities in linked libraries

Our security team is showing that some of your dependent libraries have security vulnerabilities and should be updated to the latest version. Blackduck shows that the following libraries have vulnerabilities:

org.apache.cxfย ยปย cxf-rt-frontend-jaxws | 3.0.2
org.apache.cxfย ยปย cxf-rt-transports-http | 3.0.2
org.apache.httpcomponentsย ยปย httpmime | 4.0.1

Can you update these libraries to the latest version to remove these vulnerabilities?

Make BulkSubTarget public

I would like BulkSubTarget to be public, because then I can check it via instanceof. I need to get the target id of sub targets and do not want to add an instanceof for each BulkSubTarget subclass.

To keep the class otherwise hidden, you may change the constructor to be package private.

Create enumerations for DeviceName

Create an enum for all the deviceName options for use in the DeviceCriterion. Similar to how IntentOption is used by LocationIntentCriterion.

  • All
  • Computers
  • Smartphones
  • Tablets

Migrating v10 to v11

Hi guys, there is a library built on top of this v10 sdk (https://github.com/davidesner/keboola-bingads-ex). I'd like to port it to the v11, do you have any experience with the compatibility? I've read the changelog, but I found it hard to assess the implications to this sdk. Would simply changing the imports from

import com.microsoft.bingads.v10.bulk.BulkDownloadEntity;
import com.microsoft.bingads.v10.bulk.BulkOperationProgressInfo;
import com.microsoft.bingads.v10.bulk.BulkServiceManager;
import com.microsoft.bingads.v10.bulk.DataScope;
import com.microsoft.bingads.v10.bulk.DownloadFileType;
import com.microsoft.bingads.v10.bulk.DownloadParameters;
import com.microsoft.bingads.v10.bulk.Progress;

to

import com.microsoft.bingads.v11.bulk.BulkDownloadEntity;
import com.microsoft.bingads.v11.bulk.BulkOperationProgressInfo;
import com.microsoft.bingads.v11.bulk.BulkServiceManager;
import com.microsoft.bingads.v11.bulk.DataScope;
import com.microsoft.bingads.v11.bulk.DownloadFileType;
import com.microsoft.bingads.v11.bulk.DownloadParameters;
import com.microsoft.bingads.v11.bulk.Progress;

or something along the lines work, or you expect some issues?

Unmarshailling exception when getting user using Bing SDK v11.12.2

I'm getting error below when trying to fetch the user data:

CompletionException: javax.xml.ws.soap.SOAPFaultException: Unmarshalling Error: unexpected element (uri:"https://bingads.microsoft.com/Customer/v12/Entities", local:"LinkedAccountIds"). Expected elements are <{https://bingads.microsoft.com/Customer/v12/Entities}CustomerId>,<{https://bingads.microsoft.com/Customer/v12/Entities}RoleId>,<{https://bingads.microsoft.com/Customer/v12/Entities}AccountIds>

This started failing today. Previously it was working properly. Is there any solution / workaround I can apply to fix this exception?

This is the full stacktrace:

Caused by: javax.xml.bind.UnmarshalException: null
	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:483)
	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:417)
	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:394)
	at org.apache.cxf.jaxb.JAXBEncoderDecoder.doUnmarshal(JAXBEncoderDecoder.java:855)
	at org.apache.cxf.jaxb.JAXBEncoderDecoder.access$100(JAXBEncoderDecoder.java:102)
	at org.apache.cxf.jaxb.JAXBEncoderDecoder$2.run(JAXBEncoderDecoder.java:894)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:892)
	at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:712)
	at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:179)
	at org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:194)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1670)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1551)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1348)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651)
	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	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:324)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
	... 49 common frames omitted
Caused by: com.sun.istack.SAXParseException2: unexpected element (uri:"https://bingads.microsoft.com/Customer/v12/Entities", local:"LinkedAccountIds"). Expected elements are <{https://bingads.microsoft.com/Customer/v12/Entities}CustomerId>,<{https://bingads.microsoft.com/Customer/v12/Entities}RoleId>,<{https://bingads.microsoft.com/Customer/v12/Entities}AccountIds>
	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:740)
	at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:262)
	at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:257)
	at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:124)
	at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.childElement(Loader.java:105)
	at com.sun.xml.bind.v2.runtime.unmarshaller.StructureLoader.childElement(StructureLoader.java:262)
	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:573)
	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:555)
	at com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.java:75)
	at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:246)
	at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:180)
	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:415)
	... 73 common frames omitted
Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"https://bingads.microsoft.com/Customer/v12/Entities", local:"LinkedAccountIds"). Expected elements are <{https://bingads.microsoft.com/Customer/v12/Entities}CustomerId>,<{https://bingads.microsoft.com/Customer/v12/Entities}RoleId>,<{https://bingads.microsoft.com/Customer/v12/Entities}AccountIds>
	... 85 common frames omitted

Mapping for StringTable.PromotionAdExtension missing in StaticBulkObjectFactory

Hi,

when try to upload PromotionAdExtension a get a UnknownBulkEntity instead of a PromotionAdExtension as response and the requested operation hasn't been done.

After debugging the communication between client and server I found out, that the client doesn't provide the entity type on upload and that's because no mapping for PromotionAdExtension is contained in StaticBulkObjectFactory.

Could you please add this mapping? Otherwise I'm not able to upload promotions.

Thanks

Christian

User-Agent header is causing requests to 400

The User-Agent header JAX-WS RI 2.1.5-hudson-$BUILD_NUMBER- is being set on every request and is causing a 400 invalid header response from Bing Ads. I suspect that the header value is not being escaped correctly. Right now, my work around is to remove this invalid header from the request.

OAuthTokenRequestException missing method getFaultInfo

The ExampleExceptionHelper does not seem to handle OAuthTokenRequestException. The error NoSuchMethodException is thrown in ExampleExceptionHelper.java on line 23:

// All Bing Ads exceptions have a getFaultInfo method.
Method getFaultInfoMethod = exception.getClass().getDeclaredMethod("getFaultInfo", new Class[]{});

The assumption that all Bing Ads exceptions have getFaultInfo is incorrect and is causing the issue.

Error while parsing Parent Id of failed AdGroupDeviceCriterion

If the AdGroupDeviceCriterion is failed because of any issue, the BulkFileReader stops by throwing com.microsoft.bingads.v12.bulk.EntityReadException, which in turn was caused by java.lang.NumberFormatException: For input string: "".
If the AdGroupDeviceCriterion fails, there wont be any parent Id, because of this an empty string is passed to Long.parseValue() for parent Id, causing the above errors.
I have forked it and corrected here https://github.com/charan1595/BingAds-Java-SDK

This happens only when you try to create AdGroup and AdGroupDevice Criterion from the same bulk file and AdGroup Device could not be created because of some issue ( like failing to create the parent AdGroup or duplicate device criterion)

BulkAccount.processMappingsToRowValues(RowValues values) throws java.lang.UnsupportedOperationException

writing BulkEntities with BulkFileWriter works fine for many entities, but not for BulkAccount

Exception in thread "main" java.lang.UnsupportedOperationException
at com.microsoft.bingads.bulk.entities.BulkAccount.processMappingsToRowValues(BulkAccount.java:123)
at com.microsoft.bingads.internal.bulk.entities.SingleRecordBulkEntity.writeToRowValues(SingleRecordBulkEntity.java:117)
at com.microsoft.bingads.internal.bulk.SimpleBulkObjectWriter.writeObjectRow(SimpleBulkObjectWriter.java:88)
at com.microsoft.bingads.internal.bulk.entities.SingleRecordBulkEntity.writeToStream(SingleRecordBulkEntity.java:170)
at com.microsoft.bingads.bulk.BulkFileWriter.writeEntity(BulkFileWriter.java:58)

BulkService is not detecting change in tracking template for Eligible(Delivery Status) Expanded/Ad

ExpandedAds/Ad's delivery status is eligible, I just update tracking template but bulkservice API with LastSyncTime, is not returning any delta.

code is like :

private DownloadParameters getDownloadParameter(DownloadEntity downloadEntity, String time) 
 throws ParseException {
    ArrayOfDownloadEntity entities = new ArrayOfDownloadEntity();
    entities.getDownloadEntities().add(downloadEntity);
    DownloadParameters downloadParameters = new DownloadParameters();
    downloadParameters.setDownloadEntities(entities);
    downloadParameters.setFileType(DownloadFileType.CSV);

    if (time != null && time.length() == 0) {
        downloadParameters.setLastSyncTimeInUTC(null);
    } else {
        Instant lastUpdatedAt = format1.parse(time).toInstant();
        Date date = Date.from(lastUpdatedAt);
        TimeZone timeZone = TimeZone.getTimeZone("UTC");
        Calendar cal = Calendar.getInstance(timeZone);
        cal.setTime(date);
        downloadParameters.setLastSyncTimeInUTC(cal);//fetch campaigns after lastSync time

    }
    return downloadParameters;
}

What are the enum values for AssetLink#pinnedField ?

We are trying to implement RSAs. But for setting the pins I am not able to find any documentation on how to set the pin (AssetLink#pinnedField). Since the pins are currently just strings, may you please give me the valid values?

Bad format for CustomParameters: delete_value

Looks like SDK code inserts "delete_value" token, which then it is unable to parse. StringExtensions.toCustomParaBulkString() and StringExtensions.parseCustomParameters() are not in agreement.

StringExtensions.toCustomParaBulkString()

StringExtensions.parseCustomParameters()

java.lang.IllegalArgumentException: Bad format for CustomParameters: delete_value
at com.microsoft.bingads.v10.internal.bulk.StringExtensions.parseCustomParameters(StringExtensions.java:656)
at com.microsoft.bingads.v10.bulk.entities.BulkKeyword$34.accept(BulkKeyword.java:358)
at com.microsoft.bingads.v10.bulk.entities.BulkKeyword$34.accept(BulkKeyword.java:354)

BulkServiceManager's downloadEntitiesAsync doesn't handle error 117 correctly

When making an async download request, if any of the polls for the status of the download trigger a 117- CallRateExceeded error, the entire download fails, however the download would be fine if the status poll could be retried.

It should ether wait a given time before trying again, or provide some way of defining what to do for given error codes.

BulkServiceManager should delete its temp files

The BulkServiceManager should take care that all its temp files are deleted.

Especially uploadEntitiesAsync() should delete its temp file after the upload request succeeded.
downloadEntitiesAsync() should return a BulkEntityIterable that deletes its underlying file on close().

I known that I can use cleanupTempFiles(), but that is no good option, because that tries to delete files generated by other BulkServiceManagers too.

Make intermediate entity classes public

Intermediate entity classes that are "package private" (like BulkEntityNegativeKeyword) have some downsides:

  • instanceof does not work, so generic behaviour has to be implemented for each subclass.
  • Lambdas do not work (they compile, but lead to runtime errors), e.g. BulkAdGroupNegativeKeyword::getNegativeKeyword

My suggestion: Make the classes public and instead make their constructors protected (or package private).

Bulk entity uploader is not setting timezone in CSV output

I am uploading off-line conversions through new BulkServiceManager(authorizationData(), environment).uploadEntitiesAsync(entityUploadParameters,null). But this is not setting the time zone in the CSV file generated. Also I am sending conversion value to it but the bing UI still shows revenue as 0.

Please update CXF

I have problems with JDK11 and the rather old cxf dependency of Bing Ads. May you please update it to a more recent version?

java.lang.NoSuchMethodError: org.codehaus.stax2.ri.EmptyIterator.getInstance()Lorg/codehaus/stax2/ri/EmptyIterator;
at com.ctc.wstx.sw.OutputElementBase.getPrefixes(OutputElementBase.java:358) ~[woodstox-core-asl-4.4.1.jar!/:4.4.1]
at org.apache.cxf.staxutils.StaxUtils.writeStartElement(StaxUtils.java:813) ~[cxf-core-3.0.15.jar!/:3.0.15]
at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:760) ~[cxf-core-3.0.15.jar!/:3.0.15]
at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:724) ~[cxf-core-3.0.15.jar!/:3.0.15]
at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:214) ~[cxf-rt-bindings-soap-3.0.15.jar!/:3.0.15]
at org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:174) ~[cxf-rt-bindings-soap-3.0.15.jar!/:3.0.15]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) ~[cxf-core-3.0.15.jar!/:3.0.15]
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:520) ~[cxf-core-3.0.15.jar!/:3.0.15]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:429) ~[cxf-core-3.0.15.jar!/:3.0.15]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330) ~[cxf-core-3.0.15.jar!/:3.0.15]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:283) ~[cxf-core-3.0.15.jar!/:3.0.15]
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) ~[cxf-rt-frontend-simple-3.0.15.jar!/:3.0.15]
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:138) ~[cxf-rt-frontend-jaxws-3.0.15.jar!/:3.0.15]
at com.sun.proxy.$Proxy344.getAccountsInfo(Unknown Source) ~[?:?]

Invalid response, when 0 custom parameters

When creating a new (broad match modified) keyword with zero custom parameters (a CustomParameters object with an ArrayOfCustomParameter "parameter" containing an empty list "customParameter") via the BulkServiceManager, the resulting bulk entity is either corrupt or the client lib cannot parse it correctly. The client expects custom parameters to be in the format "{_key}=value". But the server returns "delete_value" in the "Custom Parameter" column.

Stacktrace of bingads client 12.0.3:

java.lang.IllegalArgumentException: Bad format for CustomParameters: delete_value
	at com.microsoft.bingads.v12.internal.bulk.StringExtensions.parseCustomParameters(StringExtensions.java:857)
	at com.microsoft.bingads.v12.bulk.entities.BulkKeyword$34.accept(BulkKeyword.java:360)
	at com.microsoft.bingads.v12.bulk.entities.BulkKeyword$34.accept(BulkKeyword.java:356)
	at com.microsoft.bingads.v12.internal.bulk.SingleFieldBulkMapping.convertToEntity(SingleFieldBulkMapping.java:32)
	at com.microsoft.bingads.v12.internal.bulk.SimpleBulkMapping.convertToEntity(SimpleBulkMapping.java:16)
	at com.microsoft.bingads.v12.internal.bulk.MappingHelpers.convertToEntity(MappingHelpers.java:21)
	at com.microsoft.bingads.v12.bulk.entities.BulkKeyword.processMappingsFromRowValues(BulkKeyword.java:428)
	at com.microsoft.bingads.v12.internal.bulk.entities.SingleRecordBulkEntity.readFromRowValues(SingleRecordBulkEntity.java:111)
	at com.microsoft.bingads.v12.internal.bulk.SimpleBulkObjectReader.readNextBulkObject(SimpleBulkObjectReader.java:128)
	at com.microsoft.bingads.v12.internal.bulk.SimpleBulkStreamReader.peek(SimpleBulkStreamReader.java:132)
	at com.microsoft.bingads.v12.internal.bulk.SimpleBulkStreamReader.tryRead(SimpleBulkStreamReader.java:93)
	at com.microsoft.bingads.v12.internal.bulk.SimpleBulkStreamReader.tryRead(SimpleBulkStreamReader.java:74)
	at com.microsoft.bingads.v12.internal.bulk.SimpleBulkStreamReader.read(SimpleBulkStreamReader.java:50)
	at com.microsoft.bingads.v12.internal.bulk.EntityIterator.readNextBatch(EntityIterator.java:54)
	at com.microsoft.bingads.v12.internal.bulk.EntityIterator.updateNextBatch(EntityIterator.java:46)
	at com.microsoft.bingads.v12.internal.bulk.EntityIterator.hasNext(EntityIterator.java:27)

pom version on MASTER branch - should be "snapshot"

currently, the pom version is 10.4.2. so if i fork the project and build it locally, i get the same version as the latest release (10.4.2). according to Maven standards, the version should be "snapshot" of the next release, something like 10.4.3-SNAPSHOT.

BulkAccount missing supported fields

The BulkAccount class for both v11 and v12 appears to be missing 2 fields that are returned by the bulk API call: "MSCLKID Auto Tagging Enabled" and "Tracking Template". I've verified that these fields are returned in the file returned by the bulk API as documented for v11 here: https://docs.microsoft.com/en-us/bingads/bulk-service/account?view=bingads-11#msclkidautotaggingenabled and for v12 here: https://docs.microsoft.com/en-us/bingads/bulk-service/account?view=bingads-12#msclkidautotaggingenabled, but they simply aren't exposed by the BulkAccount class. This appears to be an oversight in the Bing Ads java sdk. Could you please add support for these fields? The field I currently care about is "MSCLKID Auto Tagging Enabled", so if adding support for the "Tracking Template" field slows things down for some reason, then please add support for the "MSCLKID Auto Tagging Enabled" field first and release. Also, we are still on version v11 of the API, so please add support for these fields to both v11 and v12.

Classes don't have constructors with parameters

Hi, I'd like to know why is it that the domain classes (for instance, CampaignScope) only have the default constructor and do not have the constructor with the parameters. The creation of some objects using setters turns quite cumbersome sometimes. Moreover, if we need to create an object and forget setting something, we would be breaking the object's invariant.

Are these classes autogenerated? If they are, where is the code that generates them? What do you think of opening a PR with the default constructors and also the constructors with parameters?

Thanks!

Invalid URLs

When using ReportingServiceManager.downloadFileAsync() to download keyword / ad performance reports I always get failures due to invalid download URLs since the 9th of july.

Maybe some escaping when generating download URLs is missing? When removing the brackets [], the URL seems to be valid. The bracket in the URL came from the report name which is included by the Bing Ads API into the download URL.

java.net.URISyntaxException: Illegal character in path at index 203: https://bingadsappsstorageprod.blob.core.windows.net/y4u-reportdataapi-19-07-18/5f58c71e-cdeb-4704-9ba9-fb8c6da2d955/07.07.2019___Datawarehouse_text_report_of_account_50008035_(fashion24_produktgruppe_J_[!portal_2!_!produktgruppe!J!]).zip?sv=2018-03-28&sr=b&sig=GHc%2BmAo3za75tZDACoj6h%2BOIrOYAVFFbWu5nNKAFUQs%3D&st=2019-07-18T15%3A04%3A45Z&se=2019-07-18T15%3A19%3A45Z&sp=r
        at java.net.URI$Parser.fail(URI.java:2915) ~[?:?]
        at java.net.URI$Parser.checkChars(URI.java:3086) ~[?:?]
        at java.net.URI$Parser.parseHierarchical(URI.java:3168) ~[?:?]
        at java.net.URI$Parser.parse(URI.java:3116) ~[?:?]
        at java.net.URI.<init>(URI.java:600) ~[?:?]
        at com.microsoft.bingads.internal.utilities.HttpClientHttpFileService.downloadFile(HttpClientHttpFileService.java:49) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingDownloadOperation.downloadResultFileZip(ReportingDownloadOperation.java:290) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingDownloadOperation.downloadFileWithFinalStatus(ReportingDownloadOperation.java:272) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingDownloadOperation.downloadResultFileAsyncImpl(ReportingDownloadOperation.java:240) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingDownloadOperation.downloadResultFileAsync(ReportingDownloadOperation.java:215) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingServiceManager.downloadReportingFileAsync(ReportingServiceManager.java:185) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingServiceManager.access$000(ReportingServiceManager.java:39) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingServiceManager$2$1.onSuccess(ReportingServiceManager.java:159) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingServiceManager$2$1.onSuccess(ReportingServiceManager.java:156) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.internal.ParentCallback.onCompleted(ParentCallback.java:25) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.internal.ResultFuture.setResult(ResultFuture.java:26) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingDownloadOperation$1.onSuccess(ReportingDownloadOperation.java:141) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingDownloadOperation$1.onSuccess(ReportingDownloadOperation.java:135) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.internal.ParentCallback.onCompleted(ParentCallback.java:25) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.internal.ResultFuture.setResult(ResultFuture.java:26) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingOperationTracker.completeTaskWithResult(ReportingOperationTracker.java:151) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingOperationTracker.completeTaskIfOperationIsComplete(ReportingOperationTracker.java:146) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingOperationTracker.access$100(ReportingOperationTracker.java:21) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingOperationTracker$3.onCompleted(ReportingOperationTracker.java:99) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.internal.ResultFuture.setResult(ResultFuture.java:26) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingOperationTracker$5.accept(ReportingOperationTracker.java:175) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingOperationTracker$5.accept(ReportingOperationTracker.java:170) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.internal.OperationStatusRetry$1.onCompleted(OperationStatusRetry.java:49) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.internal.ResultFuture.setResult(ResultFuture.java:26) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.microsoft.bingads.v12.reporting.ReportingStatusProvider$1.handleResponse(ReportingStatusProvider.java:44) ~[microsoft.bingads-12.13.3.jar!/:?]
        at com.sun.xml.ws.client.AsyncResponseImpl.set(AsyncResponseImpl.java:101) ~[jaxws-rt-2.3.2.jar!/:2.3.2]
        at com.sun.xml.ws.client.sei.AsyncMethodHandler$SEIAsyncInvoker$1.onCompletion(AsyncMethodHandler.java:150) ~[jaxws-rt-2.3.2.jar!/:2.3.2]
        at com.sun.xml.ws.client.Stub$1.onCompletion(Stub.java:530) ~[jaxws-rt-2.3.2.jar!/:2.3.2]
        at com.sun.xml.ws.api.pipe.Fiber.completionCheck(Fiber.java:897) ~[jaxws-rt-2.3.2.jar!/:2.3.2]
        at com.sun.xml.ws.api.pipe.Fiber.run(Fiber.java:793) ~[jaxws-rt-2.3.2.jar!/:2.3.2]
        at com.sun.xml.ws.api.server.ThreadLocalContainerResolver$2$1.run(ThreadLocalContainerResolver.java:82) ~[jaxws-rt-2.3.2.jar!/:2.3.2]

Campaign Service is not building due to missing operation in wsdl

When upgrading to version 13.0.7 it seems the the campaign service can no longer be created. I am getting the following error:

Undefined operation name AddBidStrategies

Looking at the campaign service wsdl endpoint here: https://campaign.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v13/CampaignManagementService.svc?wsdl
I can only see request and response headers for AddBidStrategies and no operation. Can you please update the wsdl accordingly? Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.