AJAX calling an external webservice from the client: Difference between revisions

From DataFlex Wiki
Jump to navigationJump to search
No edit summary
(answer)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Problem description from [[User:PERT]] ==
== Problem description from [[User:PERT| Per Thomson]] ==
I'm going to use an external [[WebService]] which check if an adress exist.
I'm going to use an external [[WebService]] which check if an adress exist.


Line 7: Line 7:


The client/user type in a new address on a page that use the [[AJAX_Library_for_Visual_DataFlex]]    but the address has to be validated before a save may be performed.
The client/user type in a new address on a page that use the [[AJAX_Library_for_Visual_DataFlex]]    but the address has to be validated before a save may be performed.


== Solving it ==
== Solving it ==
Line 13: Line 12:
In overall the easy way would be to call the external webservice on the serverside.  It is rather complex handling [[SOAP]] in javascript --[[User:Jka|Jka]] 15:03, 13 September 2007 (CEST)
In overall the easy way would be to call the external webservice on the serverside.  It is rather complex handling [[SOAP]] in javascript --[[User:Jka|Jka]] 15:03, 13 September 2007 (CEST)


I agree - handling it in the [[JavaScript]] is less than ideal, as this would be an example of [http://en.wikipedia.org/wiki/Cross-site_scripting cross site scripting] (in the sense that a script would be calling a site other than the one it was served from - OK in this context, but might be blocked by some security controls).  It will be a little slower, but in all probability this will not show up to the user.  [[User:Mikepeat|Mike]] 16:10, 22 November 2007 (CET)


== General knowledge ==
== General knowledge ==
Line 27: Line 27:


[[Category:AJAX]]
[[Category:AJAX]]
[[Category:Web Services]]
[[Category:Challenges]]
[[Category:Challenges]]

Latest revision as of 17:10, 22 November 2007

Problem description from Per Thomson

I'm going to use an external WebService which check if an adress exist.

A year ago I tested using webservice a little so I shouldn't be quite unfamilar with that subject but . . . So far I have created a webservice client subclass from the WSDL.

Now I'm stuck about how to invoke the external webservice.

The client/user type in a new address on a page that use the AJAX_Library_for_Visual_DataFlex but the address has to be validated before a save may be performed.

Solving it

In overall the easy way would be to call the external webservice on the serverside. It is rather complex handling SOAP in javascript --Jka 15:03, 13 September 2007 (CEST)

I agree - handling it in the JavaScript is less than ideal, as this would be an example of cross site scripting (in the sense that a script would be calling a site other than the one it was served from - OK in this context, but might be blocked by some security controls). It will be a little slower, but in all probability this will not show up to the user. Mike 16:10, 22 November 2007 (CET)

General knowledge


attaching a javascript function to onBeforeSave (inside initForm):

oForm.onBeforeSave = function(oVdfForm, sTable){
       alert("onBeforeSave: " + oVdfForm + " " + sTable);
   }