Theeeus / fedex-nodejs

Making a rate request to FedEx web service using node.js
11 stars 7 forks source link

FedEX web services using node.js #1

Open harshavarun25 opened 6 years ago

harshavarun25 commented 6 years ago

Is there a way where we can dynamically plugin the values into fedex soap request? Assuming that all request from all the clients wouldn't be the same. I am trying to access fedEx, DHL and UPS web services. If someone could help me achieve the best practice it it would be great.

Theeeus commented 6 years ago

Yes, just use a form to send information to the server.

You can change the "/rate" route to handle POST requests and use the information sent by the user to create the "params" argument that is passed to the "client.getRates" function instead of importing it from /params/rateRequest.js'

harshavarun25 commented 6 years ago

Thank you. I totally understand that and that is how I did it. My question is that not all user requests for rate would be same. For example what if a user wants to know clearance entry fee on the fedex rate services for which we should plug in this field into the XML request and get the desired response for the user. To do this I am assuming it would be really hard because there are several fields in the rate request of fedex for which dynamically plugging in a new field would be a problem. What do you think is the best practice on this ?

Thank you so much.