4

I am new to using WSDL's. I have used REST before but not this. I am trying to run the sample code file that is included on the UPS developer site. Page 23 of this guide is the API I am using. The file you can download includes like ten guides which I have perused, but I just initally want to figure out how to fill out the top configuration part below (I am using php example code file SoapRateClient.php). What do I put for WSDL? What do I put for end point url? The file you download on their site has several wsdl files and I'm not sure which one I am supposed to choose. Guidance appreciated.

<?php

  //Configuration
  $access = "secret";//I have this no problem
  $userid = "";//I have this as well
  $passwd = "";//I have this
  $wsdl = " Add Wsdl File Here ";//What the heck do I put here!?
  $operation = "ProcessRate";
  $endpointurl = ' Add URL Here';//Also what do I put here?
  $outputFileName = "XOLTResult.xml";

3 Answers 3

6

For anyone else out there confused on how to get started with the UPS Rate API, I implemented Jonathan Kelly's UPS Rate API class that he created. You just fill in your account number, key, username, password, and play with the other variables. I was able to return a dollar amount for ground shipping in five minutes. Thank gosh I didn't have to mess with SOAP and web services.

4

Here is details of top parameters for "SoapRateClient.php"

  1. $access = "xxxx"; It is provided by the UPS.for this you have to create your account at UPS.This account is different from creating online account at the website. https://www.ups.com/upsdeveloperkit click on "Step 5: Request an access key."

2 $userid = "xxx"; userid of account.

3 $passwd = "xxx"; password of account

4 $wsdl = "wsdl/RateWS.wsdl"; this is the wsdl file you need to include for "SoapRateClient.php". Here change the path accordingly. 5 $operation = "ProcessRate"; value of operation to perform. 6

$endpointurl = 'https://wwwcie.ups.com/webservices/Rate';
3

I wish you the best of luck. When I started down this path I ended up grabbing code from several commerce products written in PHP to see how they did it as I could not get the UPS examples to work. Turns out most of them are just doing a POST and manually assembling the XML instead of using SOAP, since it's so painful.

But, regardless, what it wants in $wsdl is the wsdl file location.

End point url is the UPS url for the service you wish to use, for example, for TimeInTransit:

For prod: https://wwwcie.ups.com/ups.app/xml/TimeInTransit

For test: https://onlinetools.ups.com/ups.app/xml/TimeInTransit

EDIT: It appears that the urls above are incorrect. Reference: https://developerkitcommunity.ups.com/index.php/Special:AWCforum/st/id267

Once your testing is completed please direct your Shipping Package XML to the Production URL: https://onlinetools.ups.com/webservices/Ship

They should read:

For test: https://wwwcie.ups.com/ups.app/xml/TimeInTransit

For prod: https://onlinetools.ups.com/ups.app/xml/TimeInTransit

4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.