Issue with Nodejs Soap module while calling fedex services

fedex tracking api example
fedex web services sample code c#
fedex web services sample code php
fedex certification
fedex fuse
https://www.fedex.com › developer
fedex label approval
fedex dev center

I am using nodejs soap module to call fedex services but getting an error:

  {
   "HighestSeverity": "ERROR",
   "Notifications": [
         {
         "Severity": "ERROR",
         "Source": "prof",
         "Code": "1000",
         "Message": "Authentication Failed"
         }
    ],
 "Version": {
    "ServiceId": {},
     "Major": {},
    "Intermediate": {},
   "Minor": {}
  }
}    

Below is my nodejs code:

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);
    });
});

But when i am sending this data with php below one then it's working.

$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);

Same code is working in php but not in Nodejs. Please let me know where is the issue?


You could try using the node-shipping-fedex module insterad of using soap directly. https://github.com/typefoo/node-shipping-fedex

Highest Voted 'fedex' Questions, Issue with Nodejs Soap module while calling fedex services · php node.js soap fedex · Oct 8 '19 at 21:23 Mike Wright. 17. 3  Fedex Web Services (SOAP): Pickup Service. only 1 hour from the pickup request you will experience problems. with Nodejs Soap module while calling fedex


I note you pasted this:

  {
   "HighestSeverity": "ERROR",
   "Notifications": [
         {
         "Severity": "ERROR",
         "Source": "prof",
         "Code": "1000",
         "Message": "Authentication Failed"
         }
    ],
 "Version": {
    "ServiceId": {},
     "Major": {},
    "Intermediate": {},
   "Minor": {}
  }
}

Is this the response that you received from the SOAP web service?

If so then you have successfully connected to and received a response, albeit containing an error specifying the following: Authentication Failed.

In the createClient() function, is there a possibility to set namespaces and prefixes that are specific to the Fedex web service in question?

Do you have a copy of the WSDL? If you do you could find out more details about exactly how the web service needs to be called and exactly what format the operations need to be called in.

I am not sure of the internal workings of the Node.js SOAP Client but what I do know is that in PHP sometimes when creating a SimpleXMLElement instance it is necessary to register the namespaces against the object in order to traverse the SOAP response with XSLT in PHP.

Package, It also provides a server that allows you to run your own SOAP services. methodAsync(args) - call method on the SOAP service. npm install soap The reasons why we disabled issues can be found here #731. node-emblue · node​-epay · node-euplatesc · node-ews · node-fedex-shipping-service · node-google-​dfp  Issue with Nodejs Soap module while calling fedex services Tags ajax android angular api button c++ class database date dynamic exception file function html http image input java javascript jquery json laravel list mysql object oop ph php phplaravel phpmysql phpphp post python sed select spring sql string text time url view windows wordpress xml


My guess is that you're using the test URLs in PHP but the live URLs in node.js. In your PHP code you use wsdl-test/ and in your node.js code you use wsdl/. If you're indeed using the test WSDL files in PHP, then I think you're ultimately resolving to https://wsbeta.fedex.com:443/web-services/rate while in node.js you're resolving to https://ws.fedex.com:443/web-services/rate where you probably don't have live access yet.

[PDF] Track Service, request for refund on a FedEx shipment must be made in accordance with the. All rights For technical support, call 1.877.339.2774 and state “API” at the voice includes using the Simple Object Access Protocol (SOAP) and Web Services The purpose of a WSDL is to completely describe a web service to a client. A. The Easy-Soap-Request Node Module. There were several popular SOAP node.js modules to choose from to perform SOAP requests with such as: soap; strong-soap; easy-soap; But I managed to find


You need to set the endpoint of the client to FedEx web services (live or sandbox) url

soap.createClient(url, function (err, client) {
    if (err)throw err; 
    //set the url before firing the function
    client.setEndpoint('https://ws.fedex.com:443/web-services');
    client.getRates(data,  function (err, result) {
        console.log(result)
        if (err)throw err;
    });
});

[PDF] Web Services Developer Guide Global, 1.3 Web Services, WSDL, and SOAP Overview . 24.6 FedEx Ground U.S. Collect On Delivery (C.O.D.) . Appendix F: Test Server Mock Tracking Numbers . For technical support, call 1.877.339.2774 and state “API” at the voice prompt. Refer to the attributes returned to help determine the problems with the address  Soap . A SOAP client and server for node.js. This module lets you connect to web services using SOAP. It also provides a server that allows you to run your own SOAP services. Features: Install; Why can't I file an issue? Where can I find help? Module. soap.createClient(url[, options], callback) - create a new SOAP client from a WSDL url.


[PDF] Rate Service, Access Protocol (SOAP) and Web Services Description Language (WSDL) standards for a function library (or a module or a class) in a traditional programming FedEx Developer Resource Center in the “Move to Production” topic. Note: For more information on pricing programs, contact your FedEx account executive. Wcf.js is a library for node.js that aims to simplify this scenario. Background . The first question that you may be asking is why do we need a special library at all for calling SOAP web services. After all HTTP is a first class citizen in node.js and we can simply send the SOAP over HTTP to the service.


Consuming SOAP Web Services in Node.js, Making a rate request to FedEx web service with node-soap Luckily for us node.js developers, there is a module that makes calling SOAP web services So go ahead and register on their website and replace the fields in the parameters file  Each API call takes a set of data in JSON format and returns data also in JSON format. The exception to this is a GET request, which instead takes its data as a query string. I didn't want to have to deal with this detail, so I cobbled together a wrapper function that would produce data in the correct format and issue the request.


Tracking request in Node.js, If we look at postal services like Fedex, UPS etc., they will provide us with a to one another using HTTP protocol following REST or SOAP architecture. Also when the web application makes any service calls it will pass along this modules which solves this problem in a very elegant way for Node js . For example, to access a database query, if the call is blocking, all processing stops, but API is non-blocking, query keeps executing and node js loop again wait for events. js request module is not built-in module by default, so we need to install it first. js web app without any external packages. incoming` object. js> Update: This article