+ Start a Discussion
johnnyg768johnnyg768 

best method to integrate a soap request/response and account update within a button?

I need to accomplish the following from within a button on the accounts page:

 

take customer account address

send SOAP request with address

receive SOAP response

update salesforce account information depending upon response

 

I am a bit overwhelmed with trying to plot out the best way to accomplish this.  The salesforce developer library is so powerful I don't know where to begin. 

 

It seems there are a number of ways I could do this, either through a visualforce page which I assume would easily be able to update the data, but I am unsure of how to embed a SOAP request and parsing the response, or via an externally linked page, which would then update the salesforce via an API after the response has been parsed.  Any thoughts would be greatly appreciated.

 

 

Sk_rkSk_rk

John

 

Here is one of the ways you can achive your goal

 

(1) Assuming you have a visualforce page where you take user input for address and there is button to handle the action. Now you need to create a custom controller which handles the action. THe method in the controller need to be a WebService method which would invoke the SOAP Service call.

 

(2) Method would handle the request/response and also do the appropriate action like update account information.

 

(3) I hope there is a WSDL for which is the SOAP Service is being used. Generate an APEX class by using the WSDL.

 

(4) The generated APEX class will be used in the controller to invoke the SOAP Service and also to read the response.

 

(5) Alternatively you can also use the HttpRequest/HttpResponse classes of SF if your WSDL to APEX does not go through well or is time taking.

 

All this should not take musch time as long as the WSDL adheres/cooperates to the SF standards. There

are numerous documents on the site to help you get started on the Web Services too.

 

Hope it helps.

 

SAnjeev