Calling Adobe Campaign Classic SOAP API in Javascript | Community
Skip to main content
davidh2892249
Level 5
April 1, 2020
Solved

Calling Adobe Campaign Classic SOAP API in Javascript

  • April 1, 2020
  • 1 reply
  • 9085 views

Hi there,

 

I've followed some examples I've found on other posts to successfully make a variety of SOAP calls in Javascript.

 

However, one that isn't working are the Write and WriteCollection methods.

 

I'm very familiar with the Write method and I've managed to add other methods and use them successfully (Logoff, GetCnxInfo, SubmitDelivery, ExecuteQuery, PostEvent) and have used a similar approach below for those?

 

See code below, could anyone advise what I'm doing wrong?

 

@marcel_szimonisz  - Any ideas?
(FYI I'm actually executing this code in a Javascript activity in a workflow of one Adobe Campaign instance, connecting to another. No clues in the workflow audit)

 

------

var cnx = new HttpSoapConnection("https://DOMAINGOESHERE.com/nl/jsp/soaprouter.jsp");

var session = new SoapService(cnx, 'urn:xtk:session');

session.addMethod("Logon", "xtk:session#Logon",
["sessiontoken", "string", "Login", "string", "Password", "string", "Parameters", "NLElement"],
["sessionToken", "string", "sessionInfo", "NLElement", "securityToken", "string"]);

 

var res = session.Logon("", "USERNAMEGOESHERE", "PASSWORDGOESHERE", <param/>);

var sessionToken = res[0];
var securityToken = res[2];


cnx.addTokens(sessionToken, securityToken);


session.addMethod("Write", "xtk:session#Write",
["sessiontoken", "string", "domDoc", "NLElement"],
[]);
//no response for this method

 

var writeRecord = session.Write("", <recipient _operation="insert" email="davidh@somedomain.com" firstName="David" xtkschema="nms:recipient"/>);



This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jonathon_wodnicki

Hi,

 

Use xtk:persist#Write.

 

Thanks,

-Jon

1 reply

Jonathon_wodnicki
Community Advisor
Jonathon_wodnickiCommunity AdvisorAccepted solution
Community Advisor
April 2, 2020

Hi,

 

Use xtk:persist#Write.

 

Thanks,

-Jon

davidh2892249
Level 5
April 2, 2020
Thank you so much Jon,