An infrastructure error indicates a communication failure on the part of either the application (including the SOAP client) or the eBay servers. This might include such things as passing an invalid token to authenticate the API call's requesting user.

Use the following guidelines to handle an infrastructure error:

  • Symptoms

    No response, unable to connect to eBay, a database error is returned, or a structured exception is returned.

  • Retry two times
  • Actions:

    • Test connectivity.
    • Refer to API Status to determine if there is a known issue with the API.
    • Contact Support

When an infrastructure error occurs, eBay returns a SOAP fault that specifies the details of the errors (FaultDetail). Note that in certain cases a SOAP fault generated by the web services framework (AXIS) may be returned without a FaultDetail node included. An example that can trigger such a case is if an integer is specified for the DetailLevel field in the request instead of a valid value for that property. SOAP faults are returned as HTTP 500 error responses, in accordance with the SOAP 1.1 standard.

The fault details object includes a unique code (ErrorCode) that identifies the particular error condition that occurred. It also provides a message (DetailedMessage) that indicates the cause of the problem.

When using the Trading API SDK for Java, this error classification includes AxisFault exceptions.

For the SOAP version of Trading API, four general types of SOAP faults are used for infrastructure errors.

Fault Type Meaning
Client faults

These indicate that a problem occurred with the metadata that your application submitted. These types of faults fall into these categories:

  • Request authentication failures (unsupported verb, the application is not allowed to make this request, etc.)
  • Application authentication failures (invalid certificates, invalid or missing tokens, etc.)
  • User authentication failures (the requesting user is not a registered member, etc.)
  • Malformed requests (the XML is not well-formed, the encoding is not supported, etc.)
Server faults

These indicate that a problem occurred within eBay's infrastructure. These are some examples of conditions that result in such faults:

  • The API servers are not available.
  • A database connection error occurred.
VersionMismatch fault These indicate that the SOAP envelope information your application passed is incorrect. Be sure the localname and namespace match the SOAP version we support, which is SOAP 1.1.
MustUnderstand fault These indicate that a problem occurred with the Web services infrastructure. For example, this type of fault may occur when the SOAP processor on the server cannot process a header element that was sent via your SOAP client. If you are using an eBay SOAP client report the issue to eBay Developer Support. If you are using a different SOAP client, refer to the Release Notes or Known Issues before contacting eBay to discuss the problem.

The SDKs translate SOAP infrastructure-level errors (and, in the case of the Trading API SDK for Java, AxisFault errors) into ApiException and SdkException objects. Two key properties are the following:

  • The ErrorType property which indicates the type of ApiException error
  • The Message property which contains the text message of the SdkException exception

An infrastructure error can have one of two severity levels. The severity level indicates whether the request should be resent or another action needs to be taken in response to the error.

Severity Level Meaning
Error

This means the request was not processed.

  • If a serious infrastructure error occurs due to a problem on the client side, please resolve the problem before attempting to retry the request.
  • If a serious infrastructure error occurs due to a problem on eBay's side, your application can retry the request as-is a reasonable number of times (eBay recommends twice). If the error persists, contact Developer Technical Support. Once the problem has been resolved, your application can re-send the request in its original form.
Warning

This means the request was processed successfully, but something occurred that you should be aware of.

  • If a client-side warning is returned, you do not need to retry the request. However, depending on the cause or nature of the warning, you may want to resolve the problem.
  • If a server-related warning is returned, you do not need to retry the request. However, you may want to contact Developer Support to obtain a long term solution to the problem to prevent it from reoccurring in the future.

The following example, which applies to the SOAP version of Trading API, shows one way to handle infrastructure error message data using C#.

Example: Catching Infrastructure Errors (C#)

System.Xml.XmlNode details = soapex.Detail;

string severity = "";
string longmsg = "";
string errcode = "";
string srtmsg = "";
try
{
   severity = details.SelectSingleNode("/FaultDetail/Severity").InnerText;
   longmsg = details.SelectSingleNode("/FaultDetail/DetailedMessage").InnerText;
   errcode = details.SelectSingleNode("/FaultDetail/ErrorCode").InnerText;
   srtmsg = soapex.Message;
}
catch (System.NullReferenceException)
{
   severity = "Error";
   longmsg = soapex.Message;
   errcode = "0";
   srtmsg = soapex.Code.Name;
}
SeverityCodeType type = SeverityCodeType.Error;
if (severity != "Error")
   type = SeverityCodeType.Warning;
errorType.ErrorCode = errcode;
errorType.SeverityCode = type;
errorType.LongMessage = longmsg;
errorType.ShortMessage = srtmsg;
// Return or print the error data you need

Other errors in the SDKs

In the case of the SDKs, all other exception types (aside from application-level and infrastructure-level errors) are translated into SdkException objects. Surround critical application operations in a try..catch construct to handle these exceptions. Use the SdkException.getInnerThrowable( ) method to get the exact exception that occurred.