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";
CaitlinHavener
  • 1,408
  • 3
  • 24
  • 53

3 Answers3

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.

CaitlinHavener
  • 1,408
  • 3
  • 24
  • 53
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';
Amit Dave
  • 586
  • 6
  • 13
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

jk.
  • 14,365
  • 4
  • 43
  • 58
somedev
  • 1,053
  • 1
  • 9
  • 27
  • There are like 6 wsdl files to choose from, lol. Guess I'll just try a couple. Thanks for the endpoint. – CaitlinHavener Jun 11 '13 at 19:00
  • 1
    You may find this helpful: https://github.com/gavroche/ups-api-php it doesn't use soap and is widely used. – somedev Jun 11 '13 at 19:03
  • That doesn't cover the Rate api but this looks intriguing: https://github.com/jonathanwkelly/UPS-Shipping-Rate-Class-Using-PHP – CaitlinHavener Jun 11 '13 at 19:19
  • 1
    Actually I believe the wwwcie.ups address is the test server, and onlinetools.ups is the production. – Shaggy Sep 04 '13 at 06:15