function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
cpinacpina 

Communications from Salesforce to the world

Hello,

I'm designing an application for SalesForce. I need to communicate to some other server, from this application (Apex Code, not external using SOAP, etc.)

I have two things in my mind:
a) Apex Code connects to other server. But I think that Apex doesn't have this capabilities (searching for TCP, etc. in documentations doesn't show me anything)

b) Use some Javascript code in client side who will connect to exterior.

For my purposes "b" is enough, if Javascript allows it :) (because security reasons and so on, but I can change users settings).

Am I forgetting to study some other option?

Thank you very much,

Carles
RickyGRickyG
Carles -

You might be able to address this issue by sending an outbound message with workflow.  This option gives you guaranteed asynchronous delivery, which might be more approriate for your application. 

Take a look at the on-line help for the feature.  It essentially hides the underlying SOAP stuff and gives you a WSDL the target server can use.

Hope this helps.

cpinacpina
Hello all and RickyG,

Thanks for the answer. I will check what you explain, but we need need synchronous and not asyncrhonous.

Anyway, about my original question, this question is answered in salesforce_apex_language_reference.pdf , page 10 (it says that cannot "Run apps that use network resources").

And just for information, I could communicate (not in Salesforce, only a test) a Javascript page to other server (changing a variable in about:config in Firefox to allow communication to other servers). So, if I can embed Javascript associated to a button I will be able to do what I need. I don't like this solution a lot (add Javascript code) but I don't see any better solution.

Thanks!

Carles
SuperfellSuperfell
You can make SOAP calls from Apex Code (to an external server), see the section on the docs on importing a WSDL.
TheDevLifeTheDevLife
cpina,
 
Salesforce.com provides a safe way to connect to remote servers from within the browser called remote proxy. This would allow you to do GETs/POSTs to an URL from javscript running inside of the web browser. See page 34 of the Salesforce.com AJAX reference guide you'll find on this site.
 
Randy