Hi Team,
We are trying to make a SOAP call from the adobe campaign java script and it is having basic authentication mechanism, when we tried to hit the url we are able to connect to the external server / system from SOAP UI, but when we use the same SOAP body in our java script activity we are getting error as INT - 150012 The HTTP query retured a 'Internal Server Error' type error (500) '. Hoping that we are doing some mistake in our JS activity while we are trying to send the data to external system. Requesting an help here :-
var req = new HttpClientRequest("<external url>");
req .header["Content-Type"] = "text/xml; charset=utf-8";
req .header["SOAPAction"] = "<url>";
req .method = "POST";
req .header["Authorization"] = "Basic " +"<base64 encoded credentials>";
//req .header("Authorization","Basic" +"<base64 encoded credentials>");
//req .execute();
vars.soapreq= '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ext="http://<external system url>">'+
'<soapenv:Header/>'+
'<soapenv:Body>'+
.
.
.
.
</soapenv:Body>+
'</soapenv:Envelope>';
logInfo("Ending soap request");
req.execute();
var req2= req.response;
logInfo("Response is"+req2.body.toString());
Thank you,
Adithya
Solved! Go to Solution.
Thanks @pablo.rosero
I got this sorted and the code is working. For anyone who is encountering a similar error here are some tips:
1) Ensure that the URL is part of the urlPermissions in the serverconf.xml
2) Ensure that the datatype in the function is correct. Hint: use long instead of int64
3) For initialising the HttpSoapConnection use the proper protocol. example: document.cnx = new HttpSoapConnection('http://www.dneonline.com/calculator.asmx', 'utf-8', HttpSoapConnection.SOAP_11)
Lastly, if you need additional details then look at the logs, if you don't get enough information then try executing the code outside of campaign within a Javascript.
Views
Replies
Total Likes
Hi Adithya,
Sorry for the late reply, were you able to find a solution?
Florent
Views
Replies
Total Likes
Hi Adithya,
Do you have any update to share on your issue?
Florent
Views
Replies
Total Likes
Hi florentlb
I am getting the same Internal Server error.
I am trying to call an external Soap service through my Javascript activity. Here is my code:
document.cnx = new HttpSoapConnection('http://www.dneonline.com/calculator.asmx', 'utf-8', 0)
document.soapSrv = new SoapService(cnx, 'http://www.dneonline.com/calculator.asmx?op=Add')
document.soapSrv.addMethod('Add', 'xtk:session#Add',
['intA', 'long','intB', 'long'],
['AddResult', 'long'])
var soapResult = document.soapSrv.Add(1,2)
if( soapResult.*.length()==0 )
return null
return soapResult
Any help is appreciated. I am stuck for days
Error:
10/17/2018 8:14:29 AM js SCR-160012 JavaScript: error while evaluating script 'WKF38/js'.
10/17/2018 8:14:29 AM js INT-150012 The HTTP query returned a 'Internal Server Error' type error (500)
Adhiyan Can you please check?
Views
Replies
Total Likes
Thanks @pablo.rosero
I got this sorted and the code is working. For anyone who is encountering a similar error here are some tips:
1) Ensure that the URL is part of the urlPermissions in the serverconf.xml
2) Ensure that the datatype in the function is correct. Hint: use long instead of int64
3) For initialising the HttpSoapConnection use the proper protocol. example: document.cnx = new HttpSoapConnection('http://www.dneonline.com/calculator.asmx', 'utf-8', HttpSoapConnection.SOAP_11)
Lastly, if you need additional details then look at the logs, if you don't get enough information then try executing the code outside of campaign within a Javascript.
Views
Replies
Total Likes
Views
Likes
Replies