Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I googled for same but couldn't found any. Then i decide to it by server side in ROR</p> <p>here it is how to get UPS and Fedex xml request and response from their test servers</p> <h1>For Fedex:</h1> <pre><code>track_no = '111111111111' (This is test track no) </code></pre> <h3>This XML Request body for fedex</h3> <pre><code>xml_req = "&lt;TrackRequest xmlns='http://fedex.com/ws/track/v3'&gt;&lt;WebAuthenticationDetail&gt;&lt;UserCredential&gt;&lt;Key&gt;YOUR_ACC_KEY&lt;/Key&gt; &lt;Password&gt;YOUR_ACC_PASSWORD&lt;/Password&gt;&lt;/UserCredential&gt;&lt;/WebAuthenticationDetail&gt;&lt;ClientDetail&gt; &lt;AccountNumber&gt;YOUR_ACC_NUMBER&lt;/AccountNumber&gt;&lt;MeterNumber&gt;YOUR_ACC_METER_NUMBER&lt;/MeterNumber&gt;&lt;/ClientDetail&gt; &lt;TransactionDetail&gt;&lt;CustomerTransactionId&gt;ActiveShipping&lt;/CustomerTransactionId&gt;&lt;/TransactionDetail&gt; &lt;Version&gt;&lt;ServiceId&gt;trck&lt;/ServiceId&gt;&lt;Major&gt;3&lt;/Major&gt;&lt;Intermediate&gt;0&lt;/Intermediate&gt;&lt;Minor&gt;0&lt;/Minor&gt;&lt;/Version&gt; &lt;PackageIdentifier&gt;&lt;Value&gt;#{track_no}&lt;/Value&gt;&lt;Type&gt;TRACKING_NUMBER_OR_DOORTAG&lt;/Type&gt;&lt;/PackageIdentifier&gt; &lt;IncludeDetailedScans&gt;1&lt;/IncludeDetailedScans&gt;&lt;/TrackRequest&gt;" path = "https://gatewaybeta.fedex.com:443/xml" #this url connects to the test server of fedex # for live server url is:"https://gateway.fedex.com:443/xml" url = URI.parse(path) http = Net::HTTP.new(url.host,url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE response = http.post(url.path, xml_req) response_body = response.body res = response_body.gsub(/&lt;(\/)?.*?\:(.*?)&gt;/, '&lt;\1\2&gt;') hash = Hash.from_xml(res.to_s) and that's it you will get response in hash variable, I converted xml response in to Hash because we can easily use Hash object at our view to display response data. </code></pre> <h1>For UPS:</h1> <pre><code>track_no = '1Z12345E1512345676' (This is test track no) </code></pre> <h3>This XML Request body for UPS</h3> <pre><code>xml_req = '&lt;?xml version="1.0"?&gt;&lt;AccessRequest xml:lang="en-US"&gt;&lt;AccessLicenseNumber&gt;YOUR_ACC_LICENCE_NUMBER&lt;/AccessLicenseNumber&gt; &lt;UserId&gt;YOUR_ACC_USER_ID&lt;/UserId&gt;&lt;Password&gt;YOUR_ACC_PASSWORD&lt;/Password&gt;&lt;/AccessRequest&gt; &lt;?xml version="1.0"?&gt;&lt;TrackRequest xml:lang="en-US"&gt;&lt;Request&gt;&lt;TransactionReference&gt; &lt;CustomerContext&gt;QAST Track&lt;/CustomerContext&gt;&lt;XpciVersion&gt;1.0&lt;/XpciVersion&gt;&lt;/TransactionReference&gt; &lt;RequestAction&gt;Track&lt;/RequestAction&gt;&lt;RequestOption&gt;activity&lt;/RequestOption&gt;&lt;/Request&gt; &lt;TrackingNumber&gt;#{track_no}&lt;/TrackingNumber&gt;&lt;/TrackRequest&gt;' path = "https://www.ups.com/ups.app/xml/Track" url = URI.parse(path) http = Net::HTTP.new(url.host,url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE response = http.post(url.path, xml_req) response_body = response.body hash = Hash.from_xml(response_body.to_s) </code></pre> <p>this hash variable contains the response of UPS Tracking Request in Hash format</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload