Salesforce Certified Application Architect

Thursday, 6 August 2015

Web Service Callout - External server did not return any content

Solution :

The issue was from the server side. Endpoint in the wsdl was not correct. The endpoint in the wsdl is http. It should be https, Since http SFDC does not support.
Thanks
Gaurav

Wednesday, 5 August 2015

System.CalloutException: IO Exception: Detect premature EOF while hitting external server

In SFDC to SAP PI integration​n, when hitting to SAP PI server got System.CalloutException: IO Exception: Detect premature EOF .


Solution:

The receiving server had a firewall blocking the SF IP addresses therefore we have to whitelist our IP address with external server.

 Hope this info is useful to others in services !!

Thanks
Gaurav

No response is coming back from endpoint ,The problem is not continuous and the system works most of the time in Inbound call .

There really isn't anything to log that I can tell; the failures are just time-outs, so I don't have an error message to work with.

Solution :

Ensure session id should generate while invoking SFDC from third party for each and every transaction .Since without session id, third party can not logged-in SFDC in Inbound call .

Note :  Since without session id end point can not send request to  SFDC also does not appear any debug log in SFDC.


Thanks
Gaurav

Tuesday, 4 August 2015

Web service EXCEPTION_THROWN|[23]|System.CalloutException: IO Exception: Read timed out

Hi ..

Please see the solution  below for the exception .
Class Stub =new class ();
Stub.timeout_x= 2000. //Time out in millisecond

Thanks
Gaurav

Webservice Callout Limits and Limitation..

The following limits and limitations apply when Apex code makes a callout to an HTTP request or a Web services call. The Web services call can be a SOAP API call or any external Web services call.

  • A single Apex transaction can make a maximum of 10 callouts to an HTTP request or an API call.
  • The default timeout is 10 seconds. A custom timeout can be defined for each callout. The minimum is 1 millisecond and the maximum is 120,000 milliseconds. See the examples in the next section for how to set custom timeouts for Web services or HTTP callouts.
  • The maximum cumulative timeout for callouts by a single Apex transaction is 120 seconds. This time is additive across all callouts invoked by the Apex transaction.
  • You can’t make a callout when there are pending operations in the same transaction. Things that result in pending operations are DML statements, asynchronous Apex (such as future methods and batch Apex jobs), scheduled Apex, or sending email. You can make callouts before performing these types of operations.
  • Pending operations can occur before mock callouts in the same transaction. See Performing DML Operations and Mock Callouts for WSDL-based callouts or Performing DML Operations and Mock Callouts for HTTP callouts.

Find solution if you're getting the following error message, "Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':HTML'."

1. Make ensure External webservice is really available and working.
2. Validate the endpoint address of the webservice .

Thanks
Gaurav 

Sunday, 17 May 2015

Synchronous and Asynchronous calls using Apex in Salesforce

Apex can be executed synchronously or asynchronously.



Synchronous:

In a Synchronous call, the thread will wait until it completes its tasks before proceeding to next. In a Synchronous call, the code runs in single thread.

Example:

Trigger
Controller Extension
Custom Controller


Asynchronous:

In a Asynchronous call, the thread will not wait until it completes its tasks before proceeding to next. Instead it proceeds to next leaving it run in separate thread. In a Asynchronous call, the code runs in multiple threads which helps to do many tasks as background jobs.

Example:

Batch
@future Annotation

Cheers!!!

Salesforce Certified Application Architect & Certified Data Architecture and Management Designer Exam

How to pass Salesforce Certified Data Architecture and Management Designer Exam This exam was 1st architect exam for me. Its not that muc...