Oak Harbor Web Services

Request Pickup documentation and example
Explanation
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:
	PT=Pallets
	BG=Bags
	BL=Bales
	BX=Boxes
	BD=Bundles (length required)
	CT=Cartons
	CS=Cases
	CR=Crates
	DR=Drums
	LS=Loose (length required)
	PL=Pails
	PC=Pieces
	RE=Reels
	RL=Rolls (length required)
	SK=Skids
	TK=Tanks
	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">
	<SOAP-ENV:Body>
		<SOAP-ENV:requestPickup>
			<return>
				<account>##YOUR ACCOUNT EMAIL##</account>
				<key>## YOUR ACCOUNT KEY ##</key>
				<ShipperEmail>johnDoe@domain.com</ShipperEmail>
				<ShipperContact>John Doe</ShipperContact>
				<ShipperPhone>5155551212</ShipperPhone>
				<Shipper>
					<Code xsi:nil="true"/>
					<Name>ABC Mining Company</Name>
					<Address1>123 main street</Address1>
					<Address2></Address2>
					<City>PORTLAND</City>
					<State>OR</State>
					<Zip>97203</Zip>
				</Shipper>
				<PickupDate>05/30/13</PickupDate>
				<PickupReadyTime>08:00</PickupReadyTime>
				<PickupDockCloseTime>09:30</PickupDockCloseTime>
				<PickupDetails>
					<Pieces>1</Pieces>
					<Type>BD</Type>
					<Length>25</Length>
					<Weight>165</Weight>
					<DestinationZip>72202</DestinationZip>
					<Hazmat xsi:nil="true"/>
					<LiftGateNeeded>1</LiftGateNeeded>
				</PickupDetails>
				<PickupDetails>
					<Pieces>2</Pieces>
					<Type>BD</Type>
					<Length>12</Length>
					<Weight>165</Weight>
					<DestinationZip>85260</DestinationZip>
					<Hazmat>1</Hazmat>
					<LiftGateNeeded xsi:nil="true"/>
				</PickupDetails>
				<PickupDetails>
					<Pieces>3</Pieces>
					<Type>BD</Type>
					<Length>15</Length>
					<Weight>225</Weight>
					<DestinationZip>95388</DestinationZip>
					<Hazmat xsi:nil="true"/>
					<LiftGateNeeded xsi:nil="true"/>
				</PickupDetails>
				<ReferenceNumber>abc123</ReferenceNumber>
				<SpecialInstructions>Handle with Care, lotsa cool stuff in there</SpecialInstructions>
			</return>
		</SOAP-ENV:requestPickup>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

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/">
	<SOAP-ENV:Body>
		<SOAP-ENV:requestPickupResponse>
			<PickupNumber>9032580</PickupNumber>
		</SOAP-ENV:requestPickupResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>