Adapter JS
function getCitiesByCountry(countryName)
{
var request =
var request=
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET">
<soapenv:Header/>
<soapenv:Body>
<web:GetCitiesByCountry>
<!--Optional:-->
<web:CountryName>INDIA</web:CountryName>
</web:GetCitiesByCountry>
</soapenv:Body>
</soapenv:Envelope>;
var input =
{
method: 'post',
returnedContentType: 'xml',
path: '/globalweather.asmx',
body: {
content: request.toString(),
contentType: 'text/json; charset=utf-8'
}
};
var result = MFP.Server.invokeHttp(input);
return result.Envelope.Body;
};
Adapter XML
<displayName>JavaScriptSOAP</displayName>
<description>JavaScriptSOAP</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>www.webservicex.net</domain>
<port>80</port>
</connectionPolicy>
</connectivity>
<procedure name="getCitiesByCountry" secured ="false"/>
Index.js
function submitRequest()
{
var resourceRequest = new WLResourceRequest("adapters/JavaScriptSOAP/getCitiesByCountry", WLResourceRequest.POST);
resourceRequest.setQueryParameter("params", "['India']");
resourceRequest.send().then(
function(response) {
alert('response '+JSON.stringify(response.responseText));
},
function(response) {
alert("HTTP Failure "+JSON.stringify(response));
}
);
}
I need to pass parameters to http Adapters.It contains Country Name.I have included the Country name in Index js file itself.While previewing the app,I receive the error code 415,
And in console I received as
[AUDIT ] CWWKS1100A: Authentication did not succeed for user ID test. An invalid user ID or password was specified.
[AUDIT ] CWWKS1100A: Authentication did not succeed for user ID test. An invalid user ID or password was specified.
[AUDIT ] CWWKS1100A: Authentication did not succeed for user ID test. An invalid user ID or password was specified.
I have:
Eclipse Java EE IDE for Web Developers. Version: Mars.2 Release (4.5.2) Build id: 20160218-0600 Windows 7
What authentication I have to give .How to overcome the error??