Troubleshooting

Your cXML endpoint returns 500 Internal Server Error

A setup request or a purchase order fails on the buyer side with HTTP 500. On Ariba the order shows as failed. Your application may or may not have logged an error.

Short answer

A 500 means your code threw. Find the stack trace for the exact request first — the buyer can give you the time and the payloadID. In practice it is either a request shape you never tested, such as a missing optional element, or deliberate: code that answers a business rejection with HTTP 500. The second should be HTTP 200 carrying a cXML Status with the real code and text.

Causes, most likely first

Ordered by how often each one turns out to be the culprit, not by how interesting it is. Work down the list.

  1. An optional element was absent and the code assumed it

    How to confirm: The trace shows a null reference while reading ShipTo, Contact, an Extrinsic or a Comments element. Your test requests had it; this buyer’s do not.

    Fix: Treat everything the DTD marks optional as optional in code. Write a test with the smallest valid request you can build and make sure it does not throw.

  2. A business rejection is returned as a 500

    How to confirm: Your handler deliberately sends 500 for an unknown part number, a price mismatch or a closed account. To the buyer that is indistinguishable from a crash.

    Fix: Return HTTP 200 with a cXML Status whose code and text say what went wrong. Ariba’s support notes describe POs marked as failed when the supplier returns anything other than 200, and suppliers resending them once the cause is fixed.

  3. The XML parser refused the document

    How to confirm: The trace is inside the parser, often about the DOCTYPE or an external entity. A parser hardened against XXE can reject every cXML document, because every one starts with a DOCTYPE.

    Fix: Allow the DOCTYPE and disable external entity and DTD loading instead. That keeps the protection without rejecting valid documents.

  4. A dependency was down

    How to confirm: Failures cluster in time and the trace ends in a database, ERP or pricing call. Requests either side of the window succeed unchanged.

    Fix: For orders, accept and store the document first and process it afterwards, so a downstream outage does not reject an order. For setup requests, fall back to a degraded catalogue rather than failing.

If it is not on your side

Ask the buyer for the payloadID and the time of the failed request. If you cannot find it in your logs at all, the 500 came from a proxy or load balancer in front of your application, and that is where to look next.

Check the document itself

Before chasing “Your cXML endpoint returns 500 Internal Server Error” further, paste the cXML or OCI payload into our free tester. It runs in your browser and reports the structural problems buyers reject on. The interactive demo plays the whole round trip from the buyer's seat.

Open the tester Play the demo

Related questions

Will the buyer retry after a 500?

Often, and automatically, which is why a crash on order processing can turn into duplicate orders once it starts succeeding. Make order handling safe to receive twice before you fix the crash.

Which status codes should go inside the cXML Status?

The cXML codes that match HTTP meanings: 200 for success, 4xx for something wrong with the request, 5xx for something wrong on your side. Always set the text attribute too, and add a readable message in the element body.

Rather not be the one debugging this?

A free PunchOut shop runs the PunchOut round trip for you: upload from Excel, test it, invite your buyer.

Start free Send us the error