1

我正在使用meteor.js。我正在尝试调用使用 WSSecurityCert 的 Web 服务的功能。我使用 openssl 创建了一个签名密钥对,并将公钥发送给服务器管理员,以便他们将其包含在他们的密钥库中,他们说他们这样做了。他们还向我发送了他们的公钥,但我不知道将其包含在我的代码或应用程序中的哪个位置。

我的代码如下:

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")

    }
});}

当它运行时,我收到以下错误:

{ [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.....

这可能是因为服务器管理员发送给我的主机公钥未包含在我的应用程序中,如果是,我在哪里包含它?或者,我该如何解决/纠正这个问题?

4

0 回答 0