Project SilverLight 1.1 – Prototype – Part 18 Continued – Different methods of calling webservices


 SubHeading 6

In my previous post where i discussed webservices i forgot to mention something very very important! Calling webservices by “PROXY”!

Ultimately the application we are building consists of a rendered HTML page sitting on the client’s end which contains SilverLight controls, standard HTML controls and Ajax controls. The rendered page came from web server “X”, which can be considered the domain of the website the page came from eg. in my “iTunes sample” wireframe the server “X” is www.ripthispage.com . The diagram below shows this :

explanation 1

Now when the iTunes application (from the client side web page) needs to communicate with a webservice we have the following options available to us:

i ) from the clients end make a direct call to the third party webservice. This is considered a “Cross-Domain” call.

ii ) from the clients end make a call to the same domain webserver (to an exposed webservice in light red below) then proxy a call to the third party webservice. This is considered a “Proxied” call.

The diagram below hopefully explains both options better

 webservice calls 2

My previous post used “proxied” calls because that is the most flexible method acceptable from a security perspective. SilverLight and Ajax.asp.net have issues with “cross domain” calls. That is “cross domain” calls have been locked down by browsers due to abuse by hackers in the past. So the safest bet to ensure that your application works across the latest browsers is to use “proxied” webservice calls (ii).

Anyway this was my interpretation of webservice methods and im sure that there are other methods out there, feel free to send comments to me and i’m more than happy to correct mistakes and/or add extra useful information if requested.

If you want to see the latest version of the sample then go here (JF000018.ASPX) or if you want to download the full sample source code here it is (JF000018.ZIP)

Digg!  Reddit!

2 responses to “Project SilverLight 1.1 – Prototype – Part 18 Continued – Different methods of calling webservices

  1. I learned a short while back of being unable to call a 3rd party web service from client side script after trying to implement that functionality using HTML, JS and the webservice behaviour file described here.

    http://msdn2.microsoft.com/en-us/library/ms531032.aspx

    Pulled my hair out for while until i discovered why!

  2. Thank you for this blog. Thats all I will say. You most definitely have made this blog into one thing thats eye gap and important. You clearly grasp most regarding the topic, youve lined such a large amount of bases. great stuff from this part of the web. Again, thanks for this blog.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s