1

I'm trying to insert rows into my Data Extensions via the Java FuelSdk.

I'm able to get the client and get the Data Extension. Creating the row is straight forward.

I'm not able to do the actual insert. I get an IllegalArgumentException. I'm using the latest version of the Java FuelSDK jar from the GitHub. I'm also using the latest apache commons libs.

My code looks like this:

        try
        {
            ETClient client = new ETClient(new ETConfiguration());

            List<String> productFilterList = new ArrayList<String>();
            productFilterList.add("eMessages_product");
            filter = new ETSimpleFilter("Name", ETFilterOperators.EQUALS, productFilterList);
            ETDataExtension productDE = client.retrieveDataExtension(filter);

            ETDataExtensionRow row = new ETDataExtensionRow();
            row.setColumn("feedbackId", "12345678");
            row.setColumn("product-handle", "MSCS");
            row.setColumn("product-name", "MSCS");
            row.setColumn("product-quantity", "1");

            List<ETResult> results = productDE.insert(row); 
        }
        catch(ETSdkException e)
        {
            e.printStackTrace();
        }

But I'm getting this stack trace:

Sep 11, 2014 2:21:00 PM org.apache.commons.beanutils.PropertyUtilsBean invokeMethod
SEVERE: Method invocation failed.
java.lang.IllegalArgumentException: argument type mismatch
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773)
    at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1759)
    at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648)
    at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1677)
    at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1022)
    at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:313)
    at com.exacttarget.fuelsdk.ETSoapObject.toInternal(ETSoapObject.java:738)
    at com.exacttarget.fuelsdk.soap.ETCrudServiceImpl.post(ETCrudServiceImpl.java:92)
    at com.exacttarget.fuelsdk.soap.ETDataExtensionRowServiceImpl.post(ETDataExtensionRowServiceImpl.java:179)
    at com.exacttarget.fuelsdk.ETDataExtension.insert(ETDataExtension.java:240)
    at com.mt.ecom.et.TestExactTarget.main(TestExactTarget.java:59)

com.exacttarget.fuelsdk.ETSdkException: could not set property "properties" of object com.exacttarget.fuelsdk.internal.DataExtensionObject@3ed4881e[name=eMessages_product,keys=<null>,type=<null>,properties=<null>,client=<null>,partnerKey=<null>,partnerProperties=<null>,createdDate=<null>,modifiedDate=<null>,id=<null>,objectID=<null>,customerKey=<null>,owner=<null>,correlationID=<null>,objectState=<null>]
    at com.exacttarget.fuelsdk.ETSoapObject.toInternal(ETSoapObject.java:743)
    at com.exacttarget.fuelsdk.soap.ETCrudServiceImpl.post(ETCrudServiceImpl.java:92)
    at com.exacttarget.fuelsdk.soap.ETDataExtensionRowServiceImpl.post(ETDataExtensionRowServiceImpl.java:179)
    at com.exacttarget.fuelsdk.ETDataExtension.insert(ETDataExtension.java:240)
    at com.mt.ecom.et.TestExactTarget.main(TestExactTarget.java:59)
Caused by: java.lang.IllegalArgumentException: Cannot invoke com.exacttarget.fuelsdk.internal.ObjectExtension.setProperties - argument type mismatch
    at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1778)
    at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1759)
    at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648)
    at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1677)
    at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1022)
    at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:313)
    at com.exacttarget.fuelsdk.ETSoapObject.toInternal(ETSoapObject.java:738)
    ... 4 more
  • Is anyone successfully using this API? – Joseph Nelson Sep 16 '14 at 20:20
0

You would need to provide some configuration parameters to your ETClient (ClientID and ClientSecret [you can obtain them from the app centre] are common).

It looks like FuelSDK bug, but not sure about it.

Did you manage to solve the problem?

| improve this answer | |
  • I updated to a newer version of fuelsdk and re-wrote the application. – Joseph Nelson Jan 13 '16 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.