Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Sending a SOAP call from one instance to another

David__Garcia
Level 8
Level 8

If I want to START workflow from a script outside Adobe Campaign I use the following SOAP call.

POST http://localhost/nl/jsp/soaprouter.jsp HTTP/1.1

Content-Type: text/xml; charset=utf-8
SOAPAction: xtk:workflow#Start

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:xtk:workflow">
  <soapenv:Header/>
  <soapenv:Body>
  <urn:Start>
  <urn:sessiontoken>mc</urn:sessiontoken>
  <urn:strWorkflowId>986963078</urn:strWorkflowId>
  </urn:Start>
  </soapenv:Body>
</soapenv:Envelope

Now, I want to use the same logic, but start the workflow from one neolane instance to another and here is where I am stuck.

var xmlMessage =

  <strWorkflowId>287865412</strWorkflowId>

var cnx = new HttpSoapConnection("http://myotherinstance/nl/jsp/soaprouter.jsp", "utf-8", 0);

var session = new SoapService(cnx, "xtk:workflow");

session.addMethod("Start", "xtk:workflow#Start", ["sessiontoken", "string", "", "NLElement"], []);

session.Start("mc", xmlMessage);

The error states (18/01/2018 17:38:28 js JavaScript: error while evaluating script '../js'.)

I have also tried tweaking the structure of the call to;

var xmlMessage =

<workflow>

<start>

  <strWorkflowId>287865412</strWorkflowId>

</start>

</workflow>

and even using the PostEvent methods isnt working.

I can successfully send real time events to the other instance message centre using javascript but this is the first time I've tried to start a workflow from one instance to the other.

Anyone got any ideas?

florentlbAmit_KumarVipul RaghavAdhiyanJean-Serge BironAdobe Campaign

1 Accepted Solution
David__Garcia
Correct answer by
Level 8
Level 8

Hey Vipul,

I think the mc's user rights are fine, otherwise I could have not triggered a workflow start call from my local SOAP client and worked. Also I have restriction by folder turned off.

After analyzing some soap calls I found out that I was not defining the element in the call, here is how i got it to work.

var xmlMessage = <strWorkflowId>287865412</strWorkflowId>

var cnx = new HttpSoapConnection("http://myotherhost/nl/jsp/soaprouter.jsp", "utf-8", 0);

var session = new SoapService(cnx, "xtk:workflow");

session.addMethod("Start", "xtk:workflow#Start",

                        ["sessiontoken", "string", "strWorkflowId", "string"],

                        []);

session.Start("mc", xmlMessage);

"strWorkflowId", "string"ng"

View solution in original post

2 Replies
Vapsy
Employee
Employee

Hi David,

mc user has limited rights and also if you check it's settings the rights are limited to a specific folder I.e Administration / Production / Message Center / Default.

However the workflow I'm pretty sure will be outside this folder. This is a potential problem I see with the current setup.

I'll additionally test to see why there is a JS error.

Regards

Vipul Raghav

Sent from mobile

Please excuse brevity

David__Garcia
Correct answer by
Level 8
Level 8

Hey Vipul,

I think the mc's user rights are fine, otherwise I could have not triggered a workflow start call from my local SOAP client and worked. Also I have restriction by folder turned off.

After analyzing some soap calls I found out that I was not defining the element in the call, here is how i got it to work.

var xmlMessage = <strWorkflowId>287865412</strWorkflowId>

var cnx = new HttpSoapConnection("http://myotherhost/nl/jsp/soaprouter.jsp", "utf-8", 0);

var session = new SoapService(cnx, "xtk:workflow");

session.addMethod("Start", "xtk:workflow#Start",

                        ["sessiontoken", "string", "strWorkflowId", "string"],

                        []);

session.Start("mc", xmlMessage);

"strWorkflowId", "string"ng"

View solution in original post