Oak Harbor Web Services

Request Pickup documentation and example
The requestPickup() web service provides you with the ability to request a pickup and specify pickup location, pickup details, and delivery points.
You can use the WSDL located at HTTP://www.oakh.com/services/soap?wsdl as the basis for programming or configuring your own SOAP client.

Below is a PHP example of a SOAP client configuration that can access this web service.
The code example shows the requisite values for creating a pickup request that will:
	- pick up in Portland, between 08:00 and 09:30
	- deliver one 25 foot bundle weighing 165 pounds to the vicinity of the 72202 zip code (Little Rock, AR), and require a lift gate
	- deliver two 12 foot bundles weighing 165 pounds to the vicinity of the 85260 zip code (Scottsdale, AZ), and require a Hazmat routing
	- deliver three 15 foot bundles weighing 225 pound to the vicinity of the 85260 area code (Winton, CA)
Codes for the type of Pickup are as follows:
	BD=Bundles (length required)
	LS=Loose (length required)
	RL=Rolls (length required)
	TB=Tote Bins

This is provided as an example only and only intended to guide you on how you may want to go about creating your own client to request a pickup using web service.
$soapClient = new SoapClient("http://www.oakh.com/services/soap?wsdl"); $pickupRequestData = array( 'account' => 'The account email associated with your key', 'key' => 'The key provided to you by Oak Harbor Freight', 'ShipperEmail' => 'johnDoe@domain.com', 'ShipperContact' => 'John Doe', 'ShipperPhone' => '5155551212', 'Shipper' => array ( 'Code' => null, 'Name' => 'ABC Mining Company', 'Address1' => '123 main street', 'Address2' => '', 'City' => 'PORTLAND', 'State' => 'OR', 'Zip' => '97203', ), 'PickupDate' => '05/30/13', 'PickupReadyTime' => '08:00', 'PickupDockCloseTime' => '09:30', 'ReferenceNumber' => 'abc123', 'SpecialInstructions' => 'Mining supplies, top heavy', 'PickupDetails' => array ( array( 'Pieces'=>1, 'Type'=>'BD', 'Length'=>25, 'Weight'=>165, 'DestinationZip' => '72202', 'Hazmat'=>null, 'LiftGateNeeded'=>1, ), array( 'Pieces'=>2, 'Type'=>'BD', 'Length'=>12, 'Weight'=>165, 'DestinationZip' => '85260', 'Hazmat'=>1, 'LiftGateNeeded'=>null, ), array( 'Pieces'=>3, 'Type'=>'BD', 'Length'=>15, 'Weight'=>225, 'DestinationZip' => '95388', 'Hazmat'=>null, 'LiftGateNeeded'=>null, ), ), ); $result = $soapClient->requestPickup($pickupRequestData);
Following the example, you will call the requestPickup(OAKH_Model_PickupRequest) method with the input parameter being a structure conforming to the OAKH_Model_PickupRequest definition from the WSDL and containing all of the pertinent information regarding your request. If an invalid pickup parameters are requested or if any other error exists, a standard Soap Fault will be returned indicating the nature of the error. The response data is very basic, and will be the Pickup Number if successful, or a Soap Fault if unsuccessful: PickupNumber (7-digit) Likely errors described in the SOAP FAULT may be among the following: Invalid key specified for account Shipper is required Shipper is not a valid pickup location: (date time) is not a valid date (time type) is not a valid time PickupDate is not a valid date. Pickup dates can not be in the past Dock can not be closed before Pickup Ready time Dock close time has to be at least one hour longer than Pickup Ready time Pickup Date is not a serviced day of week for this shipper location. Valid Service days are: Pickup items must be less than 27 feet. Please contact Oak Harbor directly at (800) 858-8815 for special consideration (missing value type) is a required value for every pickup item Length is a required value for BD,RL,LS package types An Invalid Type of Package was specified Server error creating Pickup Request Below is an example of a well-formed request with a successful result.

Request Header
POST /services/soap HTTP/1.1
Host: www.oakh.com
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.3.8-ZS5.5.0
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.oakh.com/services/soap#requestPickup"
Content-Length: 1737

Request Data
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
				<account>##YOUR ACCOUNT EMAIL##</account>
				<key>## YOUR ACCOUNT KEY ##</key>
				<ShipperContact>John Doe</ShipperContact>
					<Code xsi:nil="true"/>
					<Name>ABC Mining Company</Name>
					<Address1>123 main street</Address1>
					<Hazmat xsi:nil="true"/>
					<LiftGateNeeded xsi:nil="true"/>
					<Hazmat xsi:nil="true"/>
					<LiftGateNeeded xsi:nil="true"/>
				<SpecialInstructions>Handle with Care, lotsa cool stuff in there</SpecialInstructions>

Response Header
HTTP/1.1 200 OK
Date: Thu, 30 May 2013 03:29:10 GMT
Server: Apache
Content-Length: 270
Connection: close
Content-Type: text/xml

Response Data
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">