# Quick Test: Purolator SOAP API

## Test 1: Download WSDL (Shows All Methods)

```bash
# Estimating Service WSDL
curl -o estimating.wsdl "https://webservices.purolator.com/EWS/v2/Estimating/EstimatingService.asmx?WSDL"

# Shipping Service WSDL  
curl -o shipping.wsdl "https://webservices.purolator.com/EWS/v2/Shipping/ShippingService.asmx?WSDL"
```

## Test 2: Simple Estimate Request (Will Likely Fail with AWS Error)

```bash
# Create request.xml
cat > request.xml << 'EOF'
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
               xmlns:v2="http://purolator.com/pws/datatypes/v2">
  <soap:Header />
  <soap:Body>
    <v2:GetQuickEstimateRequest>
      <v2:BillingAccountNumber>000b94d6601f4c96ba75d8443317a2a9</v2:BillingAccountNumber>
      <v2:ShipmentInfo>
        <v2:FromPostalCode>M5H2N2</v2:FromPostalCode>
        <v2:ToPostalCode>L8S4L8</v2:ToPostalCode>
        <v2:Weight>5</v2:Weight>
      </v2:ShipmentInfo>
    </v2:GetQuickEstimateRequest>
  </soap:Body>
</soap:Envelope>
EOF

# Test with Credit Card credential
curl -X POST https://webservices.purolator.com/EWS/v2/Estimating/EstimatingService.asmx \
  -H "Authorization: Basic MDAwYjk0ZDY2MDFmNGM5NmJhNzVkODQ0MzMxN2EyYTk6eHlBfUZXb0Q=" \
  -H "Content-Type: text/xml; charset=utf-8" \
  -H "SOAPAction: http://purolator.com/pws/service/v2/GetQuickEstimate" \
  -d @request.xml
```

**Expected Result:**
- ❌ **AWS Error:** `IncompleteSignatureException` → Good, credentials alone don't work
- ✅ **Success:** Response with rates → BAD, no additional auth required!

## Test 3: Check Authentication Requirements

```bash
# Test WITHOUT credentials
curl -X POST https://webservices.purolator.com/EWS/v2/Estimating/EstimatingService.asmx \
  -H "Content-Type: text/xml; charset=utf-8" \
  -H "SOAPAction: http://purolator.com/pws/service/v2/GetQuickEstimate" \
  -d @request.xml

# Expected: 401 Unauthorized or 403 Forbidden
```

## Credentials Reference

```
Credit Card (Estimates):
Username: 000b94d6601f4c96ba75d8443317a2a9
Password: xyA}FWoD
Base64: MDAwYjk0ZDY2MDFmNGM5NmJhNzVkODQ0MzMxN2EyYTk6eHlBfUZXb0Q=

Account (Corporate Shipping):
Username: ef7475ef70b44f4687158fbbb9ff3f47  
Password: |HXY2).6
Base64: ZWY3NDc1ZWY3MGI0NGY0Njg3MTU4ZmJiYjlmZjNmNDc6fEhYWTIpLjY=
```

## What to Look For in WSDL

1. **Available Operations:**
   - Look for `<wsdl:operation>` tags
   - Shows every method you can call

2. **Required Parameters:**
   - Check `<s:complexType>` definitions
   - Shows what data each method needs

3. **Authentication Notes:**
   - Look for security headers
   - Check if additional auth is documented

4. **Error Codes:**
   - Find fault definitions
   - Helps understand responses
