Web services 使用私钥使用节点js对soapxml进行签名

Web services 使用私钥使用节点js对soapxml进行签名,web-services,sap,ws-security,node-soap,Web Services,Sap,Ws Security,Node Soap,我正在尝试使用私钥和soapui对XML进行签名 它给出了正确的成功响应 使用以下代码生成请求am var Authorization = 'Basic ' + new Buffer((sapConfig.sap.username + ':' + sapConfig.sap.password) || '').toString('base64'); soap.createClient(__dirname + '/wsdl/SI_CARWORKZ_Customer_Sen_Sync.

我正在尝试使用私钥和soapui对XML进行签名 它给出了正确的成功响应

使用以下代码生成请求am

var Authorization = 'Basic ' + new Buffer((sapConfig.sap.username + ':' + sapConfig.sap.password) || '').toString('base64'); soap.createClient(__dirname + '/wsdl/SI_CARWORKZ_Customer_Sen_Sync.wsdl', wsdlOptions, function (err, client) { client.setSecurity(new soap.WSSecurityCert(privateKey, publicKey, password, 'utf8')); //client.setSecurity(new soap.ClientSSLSecurity(privateKey, publicKey, ca)); client.SI_CARWORKZ_Customer_Sen_Sync(details, sslOptions, function(err, result, raw, soapHeader) { console.log('%j', result); if(_.has(result, "ResponseData") && !_.isEmpty(result.ResponseData.Item)){ var status = _.pluck(result.ResponseData.Item, "Status"); if(status.indexOf('E') != -1){ return callback({status: "error", data: result}); }else{ // insert the user in mongodb sapLogs.insertCustomers(details.HEADER, function(result){ console.log("customer added"); return callback({status: "success", data: details}); }) } }else{ return callback({status: "error", data: [], message: "something went wrong." }) } }, {"Authorization": Authorization}); }); var Authorization='Basic'+新缓冲区((sapConfig.sap.username+':'+sapConfig.sap.password)| |').toString('base64'); createClient(uu dirname+/wsdl/SI_CARWORKZ_Customer_Sen_Sync.wsdl',wsdlOptions,函数(err,client){ client.setSecurity(新的soap.WSSecurityCert(privateKey、publicKey、密码“utf8”); //client.setSecurity(新的soap.ClientSSLSecurity(privateKey,publicKey,ca)); client.SI_CARWORKZ_Customer_Sen_Sync(详细信息、开发、函数(错误、结果、原始、soapHeader){ console.log(“%j”,结果); if(uu.has(result,“ResponseData”)&&&&!uu.isEmpty(result.ResponseData.Item)){ var status=uu.pull(result.ResponseData.Item,“status”); 如果(status.indexOf('E')!=-1){ 返回回调({状态:“错误”,数据:结果}); }否则{ //在mongodb中插入用户 sapLogs.insertCustomers(details.HEADER,函数(结果){ 控制台日志(“客户添加”); 返回回调({状态:“成功”,数据:详细信息}); }) } }否则{ 返回回调({状态:“错误”,数据:[],消息:“出现问题。”}) } },{“授权”:授权}); }); 但是,当我使用脚本发送签名的xml数据时,会显示错误

Error while valdiating the digital signature. The error was java.lang.NullPointerException while trying to invoke the method com.sap.security.core.ws.wss.tokens.securitytoken.BinarySecurityToken.getSecurityToken() 验证数字签名时出错。尝试调用方法com.sap.security.core.ws.wss.tokens.securitytoken.BinarySecurityToken.getSecurityToken()时出错为java.lang.NullPointerException 我的公钥或私钥有问题吗?
我已经从soapui中使用的jks文件中导出了它们