Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can add Quik! integration to your Salesforce account by using just the Quik! web services (to generate forms and to display a list of forms to users). The integration will generally take a salesforce.com developer 5 to 15 days to complete depending on the complexity of your user experience. The implementation uses Apex, JavaScript and XML.

...

The following class is used to create and post an XML SOAP request and to process the response.
public with sharing class QuikFormHttpUtility {
public static String SendSOAPRequest(string strXML )

System.debug(strXML);
string xml='';
http soap = new http();
Httprequest soap_request = new Httprequest();
Httpresponse soap_response = new Httpresponse();
//soap_request.setEndpoint('https://websvcs.quikforms.com/quikformsenginews/5300/QuikFormsEngine.asmx');
soap_request.setEndpoint('https://websvcs.quikforms.com/quikformsenginews/5300/quikformsengine.asmx');
soap_request.setHeader('SOAPAction','https://websvcs.quikforms.com/quikformsenginews/Execute'); 

soap_request.setMethod('POST');
soap_request.setHeader('Host''websvcs.quikforms.com');
soap_request.setHeader('Content-type''text/xml; charset=utf-8');
soap_request.setHeader('Content-Length''' + strXML.length()); 
soap_request.setTimeout(30000);
soap_request.setBody(strXML); 
try
{
// Send the SOAP request
soap_response = soap.send(soap_request); 
// Process the response
System.Debug(soap_response.getBody());
System.Debug(soap_response.getStatusCode());
System.Debug(soap_response.getStatus());
xml=soap_response.getBody();
return xml;
}
catch(System.CalloutException ex)
{
System.Debug('Exception thrown: ' + ex.getMessage());
throw ex;
}
catch (Exception e)
{
System.Debug('Exception thrown: ' + e.getMessage());
throw e;
}
return xml;
}
}

...

Timeout Configuration

There are 2 necessary entries to add the timeout configuration:
  • In the class, before sending the request to the http service      
1	HttpRequest req = new HttpRequest();


2	req.setTimeout(120000); // timeout in milliseconds


  • In the Visualforce page, on the call to the remote action
  • We recommend increasing to the max of 120000 milliseconds