I am using meteor.js. I am trying to call a function of a webservice that uses WSSecurityCert. I created a signed key pair using openssl and sent the public key to the sever administrator so that they include it in their keystore, which they say they did. They also sent me their public key but I don't know where to include it in my code or application.
My code is as follows:
if (Meteor.isServer) {
Meteor.methods({
getVouchers: function(){
var fs = Npm.require('fs');
var soap = Npm.require('soap');
Npm.require('ursa');
var base = process.env.PWD;
var publicKey = fs.readFileSync(base + "/cert.pem", "utf8");
var privateKey = fs.readFileSync(base + "/key.pem", "utf8");
var password = "myPassPhrase";
var url = 'http://www.smartcallesb.co.za:8091/SmartcallServices2/SmartloadService?wsdl';
try
{
var wsSecurity = new soap.WSSecurityCert(privateKey, publicKey, password, 'utf8');
var client = Soap.createClient(url);
client.setSecurity(wsSecurity);
//var result = client.SmartloadService.SmartloadServicePort.getDealerBalance(); //getAllNetworks
var result = client.getDealerBalance();
console.log(result)
}
catch (err)
{
console.log(err)
}
console.log("reached end")
}
});}
When it is run I get the following error:
{ [Error: Soap method call failed [soap-method]]
error: 'soap-method',
reason: 'Soap method call failed',
reason: 'Soap method call failed',
details:
{ [Error: soap:Client: Unexpected wrapper element getDealerBalance found.
Expected {http://www.smartcall.co.za/2010/12/service}getDealerBalance.]
{http://docs.oasis-open.org/ws-sx/ws-securitypolicy requirement
/200702}AsymmetricBinding: The transform algorithms do not match the
requirement.....
Could this be because the host public key that the server admin sent to me is not included in my application, and if so where do I include it? Or otherwise, how do I fix/correct this?