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

Web Service (SOAP) call in Adobe Campaign v6

Avatar

Avatar
Validate 10
Level 3
Senthil24
Level 3

Likes

21 likes

Total Posts

67 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
Senthil24
Level 3

Likes

21 likes

Total Posts

67 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
Senthil24
Level 3

28-07-2017

HI,

Taking reference from https://docs.campaign.adobe.com/doc/AC6.1/en/CFG_API_Web_service_calls.html  we are trying to invoke a SOAP API from a javascript , We have created a jsp page and are using the following code.  We are using Message Centre Agent's userid and password from Adobe campaign. We are not getting any response for this .Please help

<%@page contentType="text/html;charset=UTF-8"%><HTML>

<HEAD>

<TITLE>Web Services Test Client</TITLE>

<script type="text/javascript">

function test(){

  alert('test');

  var cnx = new HttpSoapConnection("http://<server-url>/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("", "username", "password", <param/>);

  var sessionToken = res[0];

  var securityToken = res[2];

  alert(sessionToken);

  alert(securityToken);

  cnx.addTokens(sessionToken, securityToken);

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

  query.addMethod("ExecuteQuery", "xtk:queryDef#ExecuteQuery",

                      ["sessiontoken", "string", "entity", "NLElement"],

                      ["res", "NLElement"]);

}

</script>

</HEAD>

<BODY onload="return test();">

hi

</BODY>

</HTML>

Regards

Senthil

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
david_garcia1
MVP

Likes

106 likes

Total Posts

182 posts

Correct Reply

41 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
MVP
david_garcia1
MVP

Likes

106 likes

Total Posts

182 posts

Correct Reply

41 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
david_garcia1
MVP

31-07-2017

I used exactly the same code mentioned in the reference and worked fine.

Here is the logInfo session and security token

https://db.tt/7vDiv2JZaA

If you are using the build in 'mc' account then you may need to whitelist the IP you are sending the request from.

Answers (7)

Answers (7)

Avatar

Avatar
Validate 10
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct Reply

231 solutions
Top badges earned
Validate 10
Validate 1
Establish
Give Back 50
Give Back 5
View profile

Avatar
Validate 10
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct Reply

231 solutions
Top badges earned
Validate 10
Validate 1
Establish
Give Back 50
Give Back 5
View profile
Amit_Kumar
MVP

28-08-2017

Hi Senthil,

Load these two js in your jsp page before invoking the call.

loadLibrary('xtk:common.js')

loadLibrary('xtk:wsdlToolbox.js')

Note: ensure your user have proper rights to execute this.

Regards,

Amit

Avatar

Avatar
Validate 1
MVP
david_garcia1
MVP

Likes

106 likes

Total Posts

182 posts

Correct Reply

41 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
MVP
david_garcia1
MVP

Likes

106 likes

Total Posts

182 posts

Correct Reply

41 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
david_garcia1
MVP

25-08-2017

I executed that code from a workflow.

Avatar

Avatar
Validate 10
Level 3
Senthil24
Level 3

Likes

21 likes

Total Posts

67 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
Senthil24
Level 3

Likes

21 likes

Total Posts

67 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
Senthil24
Level 3

27-08-2017

Hi David,

Thanks for replying.

could you pls elaborate. which workflow ? and how that workflow can be accessed from outside (like from a web site)

Thanks

Senthil

Avatar

Avatar
Validate 10
Level 3
Senthil24
Level 3

Likes

21 likes

Total Posts

67 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
Senthil24
Level 3

Likes

21 likes

Total Posts

67 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
Senthil24
Level 3

24-08-2017

Hi David,

Could you please tell me from where are you running this code?

I believe this is javascript and you are calling this from a jsp .

But i tried the same code . I am getting this error.

1285150_pastedImage_1.png

Any idea how this can be resolved?

As is the case with the other method too, i.e  HttpClientRequest.

Any help is appreciated. We are really stuck on this.

Note : IP whitelisting is done .

-Senthil

Avatar

Avatar
Validate 10
Level 3
Senthil24
Level 3

Likes

21 likes

Total Posts

67 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
Senthil24
Level 3

Likes

21 likes

Total Posts

67 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
Senthil24
Level 3

22-08-2017

Hi Florent,

I replaced the values of username and password correctly.

The reason I am not getting any response might be the fact that I am working from behind a proxy(firewall). I am not able to connect to the endpoint URL. Any idea on how to get this working?

I was able to bypass it from java code. But calling SOAP via javascript would be a less cumbersome option and less dependency too.

any help on this is much appreciated.

Thanks in advance

Senthil

Avatar

Avatar
Validate 10
Level 3
Senthil24
Level 3

Likes

21 likes

Total Posts

67 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
Senthil24
Level 3

Likes

21 likes

Total Posts

67 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
Senthil24
Level 3

09-08-2017

Thanks for the reply David.

I am working from behind a firewall (proxy) . That might be the reason that I am not getting the intended response.

While I tried the same thing through java,I applied following approach and it worked.

URL iurl = new URL("https://localhost/nl/jsp/soaprouter.jsp");

Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("ip of proxy ", 8080/*port*/));

HttpURLConnection  req = (HttpURLConnection)iurl.openConnection(proxy);

req.setRequestMethod("POST");

req.setRequestProperty("Content-Type", "text/plain; charset=utf-8");

any idea on how to achieve this via javascript?

-Thanks

Senthil

Avatar

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

236 likes

Total Posts

1,109 posts

Correct Reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

236 likes

Total Posts

1,109 posts

Correct Reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile
florentlb
Level 10

31-07-2017

Hi Senthil,

Are you correctly replacing values such as "username" "password" with their actual values?

If I remember correctly we have a similar thread to this one: Adobe Campaign - SOAP API calls from a external webservice

Let me know,

Florent.