# AAACooperDispatch Documentation
## Overview
The AAACooperDispatch class handles dispatch requests to AAA Cooper Transportation's web service for pickup number generation. The service endpoint is accessed at `http://wsportal.aaacooper.com:8188/wsportal20/wsPickUpRq`.
## Data Flow
### Request Mapping
#### Frontend → Backend → Carrier
| Frontend Field | Backend Property (DispatchRequest) | Carrier Field (wsPickUpRqRequest) | Data Type |
|---------------|-----------------------------------|-----------------------------------|------------|
| Company Name | Shipper.CompanyName | PkupCompanyName | varchar(100) |
| Address | Shipper.Address.AddressLine | PkupCompanyAddress | varchar(100) |
| City | Shipper.Address.City | PkupCompanyCity | varchar(50) |
| State | Shipper.Address.State | PkupCompanyState | varchar(2) |
| ZIP | Shipper.Address.Zip | PkupCompanyZip | varchar(10) |
| Country | Shipper.Address.Country | PkupCompanyCountry | varchar(2) |
| Email | Shipper.Email | PkupCompanyEmail | varchar(100) |
| Phone | Shipper.Phone | PkupCompanyPhone | varchar(15) |
| Contact Person | Shipper.ContactPerson | PkupCompanyContact | varchar(50) |
| Pickup Date | PickupDate | PickupDate | datetime |
| Ready Time | ReadyTime | ReadyTime | time |
| Close Time | CloseTime | CloseTime | time |
| Auth Key | AuthKey | TokenID | varchar(50) |
### Line Items Mapping
| Frontend Field | Backend Property | Carrier Field | Data Type |
|---------------|------------------|---------------|------------|
| Total Pieces | Commodities[].Pieces (sum) | LineItem.Pieces | varchar(10) |
| Total Weight | Commodities[].Weight (sum) | LineItem.TotalWeight | varchar(10) |
| Consignee Name | Consignee.CompanyName | LineItem.DestinationCompanyName | varchar(100) |
| Consignee Contact | Consignee.ContactPerson | LineItem.DestinationCompanyContact | varchar(50) |
| Consignee Address | Consignee.Address.AddressLine | LineItem.DestinationCompanyAddress | varchar(100) |
| Consignee City | Consignee.Address.City | LineItem.DestinationCity | varchar(50) |
| Consignee State | Consignee.Address.State | LineItem.DestinationState | varchar(2) |
| Consignee ZIP | Consignee.Address.Zip | LineItem.DestinationZip | varchar(10) |
| Consignee Country | Consignee.Address.Country | LineItem.DestinationCountry | varchar(2) |
| Consignee Phone | Consignee.Phone | LineItem.DestinationCompanyPhone | varchar(15) |
| Consignee Email | Consignee.Email | LineItem.DestinationCompanyEmail | varchar(100) |
| Load ID | ClientLoadId | LineItem.BOLID | varchar(50) |
| Hazmat | Commodities[].Hzmt | LineItem.IsHazmat | char(1) |
| Guaranteed Service | Commodities[].Description | LineItem.IsACTGuaranteedDay | char(1) |
### Special Handling
- If `NumberOfPallet > 0`, the system uses pallet count instead of piece count and sets `HandlingUnitType = "Pallets"`
- Comments field is limited to 100 characters and concatenates:
- Accessorial information
- PO Reference
- Shipper Number Reference
- Additional Comments
### Response Mapping
#### Carrier → Backend → Frontend
| Carrier Response Field | Backend Property (DispatchResponse) | Data Type | Description |
|-----------------------|-------------------------------------|------------|-------------|
| PickupRequestNumber | PickupNumber | varchar(50) | Successful pickup number |
| ErrorCode | HasError | bit | Error indicator |
| ErrorMessage | ErrorMessage | varchar(max) | Error details |
### Error Handling
- The system captures both request and response XML for debugging purposes
- Error responses include:
- API Request Body
- API Response Body
- Error Message from carrier
- Error status flag
### Development Mode
- When `IsDevelopment = true`, pickup comments are set to "Testing do not process"
- This prevents actual dispatch creation in the carrier's system during testing
## Technical Notes
- Uses SOAP 1.1 protocol
- Character encoding: ISO-8859-1
- Content type: text/xml
- Custom XML serialization for request/response handling
Comments
0 comments
Please sign in to leave a comment.