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?
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
Solved! Go to Solution.
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.
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
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.
Views
Replies
Total Likes
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
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.
Thanks so much DimaKudryavtsev. Your reply saved lot of time for me. I'm in the next step. I'll give an update here once I achieve what I wanted.DimaKudryavtsev
Thanks,
Somasundaram
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi Bhosale,
I am also trying to do same, is your issue resolved.
Regards,
Shloak C
Views
Replies
Total Likes