Error Handling. salesforce Metadata API
Oglas
Oglas
CHAPTER 5
Error Handling
Metadata API calls return error information that your client application can use to identify and resolve runtime errors. The Metadata API provides the following types of error handling:
•
Since the Metadata API uses the enterprise or partner WSDLs to authenticate, it uses SOAP fault messages defined in those WSDLs for errors resulting from badly formed messages, failed authentication, or similar problems. Each SOAP fault has an associated
ExceptionCode. For more details, see “Error Handling” in the
SOAP API Developer's Guide
.
•
For errors with the asynchronous create()
, and
calls, see the error status code in the statusCode field in the
object for the associated component.
•
For errors with the synchronous CRUD calls, see the error status code in the statusCode
field of the
object corresponding to each error in the array returned by the errors
field of the appropriate result object. For example, the result object of
.
•
For errors with
, see the problem
and success
fields in the
object for the associated component.
•
problem
field in the
RetrieveMessage object for the associated component.
For sample code, see
Step 3: Walk Through the Java Sample Code on page 6.
Error Handling for Session Expiration
When you sign on via the login()
call, a new client session begins and a corresponding unique session ID is generated. Sessions automatically expire after the amount of time specified in the Security Controls setup area of the Salesforce application (default two hours). When your session expires, the exception code INVALID_SESSION_ID is returned. If this happens, you must invoke the login() call again. For more information about login()
, see the
SOAP API Developer's Guide
.
32
Prenesi
Oglas