sto usando il modulo di sapone nodejs per chiamare i servizi FedEx ma ottenendo un errore:Problema con modulo Nodejs sapone durante la chiamata servizi FedEx
{
"HighestSeverity": "ERROR",
"Notifications": [
{
"Severity": "ERROR",
"Source": "prof",
"Code": "1000",
"Message": "Authentication Failed"
}
],
"Version": {
"ServiceId": {},
"Major": {},
"Intermediate": {},
"Minor": {}
}
}
Di seguito è riportato il mio codice nodejs:
var data = {};
data["WebAuthenticationDetail"] = {
"UserCredential": {
"Key": developer_key,//getProperty('key');
"Password": password
}
};
//console.log(JSON.stringify(data));
data['ClientDetail'] = {
'AccountNumber': account_number,//getProperty('shipaccount');
'MeterNumber': meter_number//getProperty('meter');
};
data['Version'] = {
'ServiceId': 'crs',
'Major': 14,
'Intermediate': 0,
'Minor': 0
};
var soap = require('soap');
var path = require('path');
var path_to_wsdl = path.resolve(__dirname + '/wsdl/RateService_v14.wsdl');
soap.createClient(path_to_wsdl, function (err, client) {
if (err)throw err;
client.getRates(data, function (err, result) {
if (err)throw err;
res.send(result);
});
});
Ma quando sto inviando questi dati con php sotto uno allora sta funzionando.
$path_to_wsdl = "wsdl-testing/RateService_v14.wsdl";
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient($path_to_wsdl /*, array('trace' => 1) */);
$request['WebAuthenticationDetail'] = array(
'UserCredential' => array(
'Key' => $developer_key,
'Password' => $password
));
$request['ClientDetail'] = array(
'AccountNumber' => $account_number,
'MeterNumber' => $meter_number,
);
$request['Version'] = array(
'ServiceId' => 'crs',
'Major' => '14',
'Intermediate' => '0',
'Minor' => '0');
$response = $client -> getRates($request);
Logger::info('here is the response====', $response);
Lo stesso codice funziona in PHP ma non in Nodejs. Per favore fatemi sapere dove è il problema?
hai la risposta? Sto avendo lo stesso problema con Magento ... ottenendo la stessa risposta .. –
Questo è il problema con Fedex. Fedex non sta analizzando i dati alla fine. Ora sto inviando i dati nello stesso formato incluso nei file di codice di esempio. – Rohit
Vorrei usare uno strumento come il violinista (http://www.telerik.com/fiddler) che può guardare il traffico mentre attraversa il filo. Probabilmente c'è qualche intestazione o qualcosa che non è impostato in modo esplicito in nodejs, ma è tramite php. –