Posting a bundle sends back error

I am trying to post a bundle transaction:

{
  "resourceType": "Bundle",
  "id": "bundle-transaction",
  "type": "transaction",
  "entry": [
    {
      "resource": {
        "resourceType": "Location",
        "identifier": [
          {
            "system": "urn:companyname:DepartmentID",
            "value": "AAAA"
          }
        ],
        "name": "AAAA",
        "physicalType": {
          "coding": [
            {
              "system": "location-physical-type",
              "code": "wa",
              "display": "Ward"
            }
          ],
          "text": "Department"
        }
      },
      "request": {
        "Method": "POST",
        "Url": "Location"
      }
    },
    {
      "resource": {
        "resourceType": "Location",
        "identifier": [
          {
            "system": "urn:companyname:DepartmentID",
            "value": "BBBB"
          }
        ],
        "name": "BBBB",
       "physicalType": {
          "coding": [
            {
              "system": "location-physical-type",
              "code": "wa",
              "display": "Ward"
            }
          ],
          "text": "Department"
        }
      },
      "request": {
        "Method": "POST",
        "Url": "Location"
      }
    }
  ]
}

When I post this to the base url I get the following message:

{
    "resourceType": "OperationOutcome",
    "id": "0b0231b8-65be-4521-85d5-394a9171f6ab",
    "issue": [
        {
            "severity": "error",
            "code": "internalerror",
            "diagnostics": "Error trying to instanciate/execute post-process FHIRProxy.preprocessors.TransformBundlePreProcess: Object reference not set to an instance of an object."
        }
    ]
}

Don’t know if this is the cause, but your Bundle entries are missing the fullUrl, which is mandatory in transaction Bundles. I’d also double-check your headers and make sure the CapabilityStatement indicates that the server supports transaction.

Given that there are no references between the resources, you could also get away with using batch rather than transaction if you don’t need all creates processed as a single unit-of-work.