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
chico_kkchico_kk 

web service from Salesforce

I want to know what is the best way to call a web service from Salesforce.
The process involves
From an Contact SF page...
1.Call a webservice that I host in my webserver
2.Creating a task associated with the contact based on the webservice result

Also
What the best way to authenticate in my web service
1 - Should I create a UsernameWs/PasswordWs Field in the User Object and pass it
or
2 - pass the sessionId
Gareth DaviesGareth Davies

use a custom link on the contact page to fire your webservice.

pass the session_id and the Url and then use that to authenticate with Salesforce.com

An easy way to get the task created would be to get the webservice to create it based on its calculations. If you cannot modify this particular webservice then perhaps consider writing a wrapper around it - if you are familiar with creating webservices.

Otherwise it would be possible to call and parse the result and create new records using the Ajax libraries.

Gareth.

chico_kkchico_kk
I tried to consume web services using Javascript
and I received "permission denied" javascript error (I found that it relates to some kind of cross-domain protection) in the folowing code
 
<script language="javascript">   
<!--
function UseWS(){

alert(url);
try{xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){
return false;}
xmlhttp.Open("POST",url,false);  ---------------- Error
 
..
...
...
 
 
So using js to consume an external web service doesn't work
 
 
So the question "how to consume webservices in SF"  is very ACTIVE
 
 
Please help me
 
 
 
 
 
 
 
 
 
 
 
 
 
RP@TranseraRP@Transera
Not quite sure her but I think IE has a limitation that in JScript it won't give you access to a site outside of your current domain for security reasons. 
 
You can try to make 'www.somedomain.com' a trusted site but I believe you will still be prompted by IE that your surfing off of your current domain unless your site is a HTTPS.
 
I have this problem in a SControl when I try to access data outside of salesforce.com
 
chico_kkchico_kk

Let me explain want I want:

I want to send a SMS to a contact

a. The user has to write the message (preferably in Salesforce) send it to my WebApplication (it could be a web service or not)

a.1 Salesforce must register a Task

a.2 After a while (up to 2 hours) the task must be Updated (SMS Delivered or Not)

 

Some Thoughts

1- I wanted to use a “JavaScript SOAP Client” to use the web service but it returns error (permission denied – it’s a security browser issue - see the following msgs).

What is the use of “Calling a Web Service”, it seems to me that they are only Web Links (googlemap, gmail, fedex etc).

 

2- Since my web application can take up to 2 hours to update the SF Task, I must do it using the .net API and save the Username and Password in the my Web App Database (the session expires in a 1 hour- so It’s out of question) , I’m I right? It could be a potential security risk.

 

3- Using the SF Ajax Library doesn’t returns an Error (permission denied – see 1.) Why?

 

Thanks  

 

 

 

chico_kkchico_kk

Let me explain want I wanted to do

I want to send a SMS to a contact

a. The user has to write the message (preferably in Salesforce) send it to my WebApplication (it could be a web service or not)

a.1 Salesforce must register a Task

a.2 After a while (up to 2 hours) the task must be Updated (SMS Delivered or Not)

 

Some Thoughts

1- I wanted to use a “JavaScript SOAP Client” to use the web service but it returns error (permission denied – it’s a security browser issue - see the following msgs).

What is the use of “Calling a Web Service”, it seems to me that they are only Web Links (googlemap, gmail, fedex etc).

 

2- Since my web application can take up to 2 hours to update the SF Task, I must do it using the .net API and save the Username and Password in the my Web App Database (the session expires in a 1 hour- so It’s out of question) , I’m I right? It could be a potential security risk.

 

3- Using the SF Ajax Library doesn’t returns an Error (permission denied – see 1.) Why?

 

Thanks