salesforce-marketingcloud / FuelSDK-Java

Salesforce Marketing Cloud Java SDK
BSD 3-Clause "New" or "Revised" License
72 stars 123 forks source link

[BUG] ETLClient createDataExtensionDataRow have too long size of the request headers for field User-Agent and request failed #130

Open hktv-tonyNg opened 3 years ago

hktv-tonyNg commented 3 years ago

Describe the bug There is bug that when using SDK method com.exacttarget.fuelsdk.ETDataExtension#insert(java.util.List<com.exacttarget.fuelsdk.ETDataExtensionRow>) to insert multiple DataExtensionRow will generate very long header value of User-Agent field and cause API return 400 Bad Request, then no DataExtensionRow can be inserted.

I am following the test case https://github.com/salesforce-marketingcloud/FuelSDK-Java/blob/master/src/test/java/com/exacttarget/fuelsdk/ETDataExtensionTest.java#L258 to try create more than 1005 dataExtensionRow in 1 call, but the API return exception

Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '400: Bad Request' when communicating with https://mc9gcnjg01hzkm7nhqwz1k0nk1z0.soap.marketingcloudapis.com/service.asmx

I enable the debug level for FuelSDK and found that the SOAP call request header have very long value like:

FuelSDK-Java-v1.5.0-SOAP-create-DataExtensionRowDataExtensionRow....(repeat)...DataExtensionRowDataExtensionRow (Please find attached log for detail java exception, line 1030)

Then i try simulate the raw soap call with POSTMAN and below error return by salesforce API

image

Sample postman collection is attached. test_DataExtensionRow_header_postman.txt

To Reproduce 1 create ETDataExtension using the test code 2 loop to build size of list of ETDataExtensionRow more than 1005 3 call ETDataExtension.insert(List ETDataExtensionRow) 4 server return 400 bad request

Expected behavior The API com.exacttarget.fuelsdk.ETDataExtension#insert(java.util.List) can invoke and insert more than 1005 row in 1 API call.

Screenshots If applicable, add screenshots to help explain your problem.

Code snippet Please check https://gist.github.com/hktv-tonyNg/03ca278ebe13f56d6a56cbe4436362d8

Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (e.g. gif) is not sufficient.

Environment

The bug has the severity

Additional context Add any other context about the problem here.