{"id":2107,"date":"2010-03-22T17:59:36","date_gmt":"2010-03-22T12:59:36","guid":{"rendered":"http:\/\/www.chiragmehta.info\/chirag\/?p=2107"},"modified":"2010-03-25T02:03:27","modified_gmt":"2010-03-24T21:03:27","slug":"salesforce-ftp-integration-data-loader-web-service-http","status":"publish","type":"post","link":"https:\/\/www.chiragmehta.info\/chirag\/2010\/03\/22\/salesforce-ftp-integration-data-loader-web-service-http\/","title":{"rendered":"Salesforce &#8211; FTP Integration (Data loader, Web service &#038; HTTP)"},"content":{"rendered":"<p><em>Author : Chirag Mehta &amp; Angelica Buffa<\/em><\/p>\n<p>Using FTP servers to store and share files is very common now at days. Most language programs let you develop FTP clients and consume their services.<\/p>\n<p>With Apex, there are three possible approaches to resolve the integration with this kind of file servers:<\/p>\n<p><strong><span style=\"text-decoration: underline;\">I &#8211; Data Loader CLI \u2013 Windows approach.<\/span><\/strong><\/p>\n<ol>\n<li>Download Salesforce Data Loader Command Line Interface (Read more at http:\/\/wiki.developerforce.com\/index.php\/Using_Data_Loader_from_the_command_line)<\/li>\n<li>Write a Widows Batch file (.bat file)<\/li>\n<li>First command in the batch file will be connect to FTP server (ms-dos command \u2018ftp\u2019) and then get the necessary files from ftp server to the local folder.<\/li>\n<li>Second set of commands execute the Data Loader CLI jar and loads step3 retrieved file into Salesforce.<\/li>\n<li>To automate the execution of the batch, we can schedule the bat file execution using scheduled task feature of Windows operating system.<\/li>\n<\/ol>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/lh4.ggpht.com\/_y0ZxewrWNLM\/S6eNELyIQ7I\/AAAAAAAAACc\/WlmOHilWqaw\/DataLoaderApproach.png\" alt=\"\" \/><\/p>\n<p><strong><span style=\"text-decoration: underline;\">II &#8211; Java Web Service<\/span><\/strong><\/p>\n<ol>\n<li>Write a Java FTP client, expose it as a Web Service<\/li>\n<li>Consume above WS into your Salesforce Org using Apex \u201cBrowse WSDL\u201d functionality<\/li>\n<\/ol>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/lh5.ggpht.com\/_y0ZxewrWNLM\/S6eNEStMXRI\/AAAAAAAAACk\/USr-_k0P4Qo\/WSApproach.png\" alt=\"\" \/><\/p>\n<p><strong><span style=\"text-decoration: underline;\">III &#8211; Http Request<\/span><\/strong><\/p>\n<ol>\n<li>Create a Http Request to the FTP server<\/li>\n<li>Handle the response using either of HttpRequest and HttpResponse Apex Class<\/li>\n<li>Ps: The problem that you can face is the size of the files. Please remember that HTTP Request size are currently limited to 100Kb of data, so larger exports would fail unless a mechanism was created to utilize multi-part transmissions.<\/li>\n<\/ol>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/lh4.ggpht.com\/_y0ZxewrWNLM\/S6eNECmoYQI\/AAAAAAAAACg\/4eQPpAuCizc\/HttpRequestApproach.png\" alt=\"\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Author : Chirag Mehta &amp; Angelica Buffa Using FTP servers to store and share files is very common now at days. Most language programs let you develop FTP clients and consume their services. With Apex, there are three possible approaches to resolve the integration with this kind of file servers: I &#8211; Data Loader CLI [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[50,171,51,169,52],"class_list":["post-2107","post","type-post","status-publish","format-standard","hentry","category-salesforce","tag-ftp","tag-integration","tag-java","tag-salesforce","tag-web-service","post-preview"],"_links":{"self":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts\/2107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/comments?post=2107"}],"version-history":[{"count":14,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts\/2107\/revisions"}],"predecessor-version":[{"id":2168,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/posts\/2107\/revisions\/2168"}],"wp:attachment":[{"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/media?parent=2107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/categories?post=2107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chiragmehta.info\/chirag\/wp-json\/wp\/v2\/tags?post=2107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}