[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FedEx API Using RPG



   Craig Jacobsen


   Did you get this webservice call to work and return detailed
   information about the tracking number ?


   Can you send me the code as an .TXT attachment


   Thanks,

   Chris






We have an internal Fedex server that does the estimated shipping charges.
It uses a FedEx service program called WEBAPICS that they provided.
However, we do track shipments through FedEx, so maybe that will help.

// set up the soap request
Soap='<soapenv:Envelope +
        xmlns:soapenv="[1]http://schemas.xmlsoap.org/soap/envelope/";; +
        xmlns:v2="[2]http://fedex.com/ws/track/v2";;> +

<soapenv:Header/> +

 <soapenv:Body> +

  <v2:TrackRequest> +

    <v2:WebAuthenticationDetail> +
     <v2:UserCredential> +
      <v2:Key>xxxxx</v2:Key> +
      <v2:Password>xxxx</v2:Password> +
     </v2:UserCredential> +
    </v2:WebAuthenticationDetail> +

 <v2:ClientDetail> +
  <v2:AccountNumber>123</v2:AccountNumber> +
  <v2:MeterNumber>123</v2:MeterNumber> +
 </v2:ClientDetail> +

 <v2:Version> +
  <v2:ServiceId>trck</v2:ServiceId> +
  <v2:Major>2</v2:Major> +
  <v2:Intermediate>0</v2:Intermediate> +
  <v2:Minor>0</v2:Minor> +
 </v2:Version> +

 <v2:PackageIdentifier> +
  <v2:Value>' + %Trim(TrackNumber) + '</v2:Value> +
  <v2:Type>TRACKING_NUMBER_OR_DOORTAG</v2:Type> +
 </v2:PackageIdentifier> +

 <v2:ShipmentAccountNumber>'+
  FedXCompany +
 </v2:ShipmentAccountNumber>+

 </v2:TrackRequest> +

</soapenv:Body> +

</soapenv:Envelope>';

// post soap service to Fed Ex (ParseXML parses information)
RC = Http_Url_Post_Xml( '[3]https://gateway.fedex.com:443/+
                         web-services'
                       : %Addr(SOAP) + 2
                       : %Len(SOAP)
                       : *NULL
                       : %PAddr(ParseXML)
                       : %Addr(RESP)
                       : HTTP_TIMEOUT
                       : HTTP_USERAGENT
                       : 'text/xml;charset=UTF-8'
                       : '"track"');
P ParseXML        B

 D ParseXML        PI
 D   Save                          *   Value
 D   Depth                       10I 0 Value
 D   Name                      1024A   Varying Const
 D   Path                     24576A   Varying Const
 D   Value                    32767A   Varying Const
 D   Attrs                         *   Dim(32767)
 D                                     const options(*varsize)

  /Free

   If Name = 'v2:Severity';
    Severity = Value;
   Endif;

  If Name = 'v2:ActualDeliveryTimestamp';
   Delivery = Value;
  Endif;

 /End-Free

P                 E




   Thanks,

   Chris Hayden

   Senior Systems Analyst

   Pilot Corporation of America

   3855 Regent Blvd, Jacksonville, FL 32224

   (904) 645.9999

   Ext. 1252

References

   1. http://schemas.xmlsoap.org/soap/envelope/%22
   2. http://fedex.com/ws/track/v2%22
   3. https://gateway.fedex.com/+
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------