Adobe Campaign - Delivery connector js for Routing

somasundaramhal

06-09-2019

Team,

We wanted to make use of Delivery and to use Custom Routing method(such as javascript connector) for processing API requests.

- We're trying to integrate other API's in Adobe campaign.

- We're able to connect to those API and send messages using workflows

- Now we want to use Delivery and input targetted addresses in the Delivery target

- Then in the backend we want to process API request using connector

- We tried to use Mobile App push connector for reference. Setting up mobile app channel

- However we failed to complete custom js connector(Attached error image for reference)

- If we execute the same code using workflows, it's working. If I use the same code in connector js, it's not working. Any idea please?

delivery-error-api-connector-js.jpg

The following are the important code snippet in the delivery connector we believe:

loadLibrary("xtk:shared/nl.js");

NL.require('/nl/core/shared/xtk.js')

  .require('/nl/core/shared/js.js');

function processDeliveryPart (deliveryPart) {

  var msgs = <messages/>;

/* API request code comes here */

  return msgs;


//-----------------------------------------------------------------------------

// Useless here, but needed by Neolane

//-----------------------------------------------------------------------------

function getStatus (xml) {

  var msgs = <messages/>;

  return msgs;

}

//-----------------------------------------------------------------------------

// Useless here, but needed by Neolane

//-----------------------------------------------------------------------------

function getMessages (xml) {

  var msgs = <messages/>;

  return msgs;

}

Thanks,

Somasundaram

Accepted Solutions (1)

Accepted Solutions (1)

DimaKudryavtsev

10-09-2019

Hi somasundaramhaldurai,

The error means that your JS code is attempting to convert some value into XML, probably, by using E4X. You are absolutely right about that the error originated in your processDeliveryPart function.

Please examine your function and verify that all XML-related code is correct.

If you want more context on where the error have originated, you can add some logInfo() calls into your code. Then open mtachild@<YourInstance> logfile and you will be able to find the log.

Answers (4)

Answers (4)

Milan_Vucetic

MVP

10-09-2019

Hi,

it seems that this error is returned from your function processDeliveryPart.

Could you, please, check your code inside of this function?

If you have some query inside and result stored to a variable, please check where are you using mentioned variable.

It is not similar problem, but please check this thread regarding error log An issue with creating backup packages

Regards,

Milan

Milan_Vucetic

MVP

10-09-2019

Hi,

do you have function for connecting web service and execution of request?

Also, try to include one more library: loadLibrary("xtk:shared/json2.js");

Could you, please, share full error log from the picture?

Regards,

Milan

somasundaramhal

10-09-2019

Hi Milan,

Thanks for your response. I tried to include the above library as you suggested. But still the same error. I've attached the image of error in the delivery.

Status: Failed

Reason: Unreachable

Targetted address: emGvjpeuMWI:APA91bGgFxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Text: Error in delivery part 1220815623: SCR-160025 JavaScript: cannot convert the value to an XML document.\

Note:

If I process the same API request in a workflow, it's working without any issues. The same address can be targetted using a workflow which works fine.

1830621_pastedImage_5.png