Exploring the depths and potentials of ASP.NET RSS 2.0 or Subscribe to .BenRush by Email
 Thursday, May 04, 2006

This will be a multi-part blog post 'cause the topic is rather extensive. This first part will describe the basics of calling web services via Atlas from the pure programmatic standpoint, plus a bit about how web proxies work in JavaScript. The other entries will go deeper.

First off, visit this Url: http://atlas.asp.net/docs/atlas/samples/services/SimpleService.asmx. What you see here is the nicey user interface wrapping this: http://atlas.asp.net/docs/atlas/samples/services/SimpleService.asmx?WSDL, the service description. If you're a web developer dealing with services, you've seen this before. No big deal.

If you append "/js" to the end of the first querystring, you see something new: http://atlas.asp.net/docs/atlas/samples/services/SimpleService.asmx/js. This is javascript; more interestingly, JavaScript wrapping the methods of the web service itself. After nicely beautifying the script, it looks like this:

Type.registerNamespace('Quickstart.Samples');
Quickstart.Samples.SimpleService=new function()
{
    this.path = "http://atlas.asp.net/docs/atlas/samples/services/SimpleService.asmx";

    this.appPath = "http://atlas.asp.net/docs/";
    var cm=Sys.Net.ServiceMethod.createProxyMethod;
    cm(this,"EchoString","s");
}

Don't worry too much about the internals of the script above as I'll go into this later (in another post). But, what you've just seen here is that the Atlas framework is capable of dynamically generating javascript to wrap the methods of the web service (the web service this code wraps has one method, EchoString, with one parameter "s"). Interacting with this downloaded code, then, is as easy as doing this:

function OnbuttonGo_click()
{
    //Call script proxy passing the input element data
   requestSimpleService = Quickstart.Samples.SimpleService.EchoString(
      document.getElementById('inputName').value, //params
      OnComplete, //Complete event
      OnTimeout //Timeout event
      );
    return false;
}

Notice the highlighted method call syntax above. It's really just that easy.

The next question is how does the Atlas client runtime know what services to retrieve proxies for; and the answer lies within the ScriptManager control:

    <atlas:ScriptManager ID="scriptManager" runat="server" EnableScriptComponents="true" >
        <Services>
            <atlas:ServiceReference Path="SimpleService.asmx" />
        </Services>
    </atlas:ScriptManager>


kick it on DotNetKicks.com
Thursday, May 04, 2006 10:24:37 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing
Tracked by:
http://freewebs.com/aspxfaq/04/sitemap7.html [Pingback]
http://freewebs.com/toltom/07/sitemap16.html [Pingback]
http://freewebs.com/toltom/06/travel-sites.html [Pingback]
http://freewebs.com/toltom/06/sitemap6.html [Pingback]
http://freewebs.com/toltom/15/x-men.html [Pingback]
"http://kevruublog.tripod.com/31.html" (http://kevruublog.tripod.com/31.html) [Pingback]
"http://fartooblog.tripod.com/13.html" (http://fartooblog.tripod.com/13.html) [Pingback]
"http://rma7dj.org/sitemap34.html" (http://rma7dj.org/sitemap34.html) [Pingback]
"http://hboegn.org/teen-clothes-juniors.html" (http://hboegn.org/teen-clothes-ju... [Pingback]
"http://topslots.nl.eu.org/01/sitemap11.html" (http://topslots.nl.eu.org/01/site... [Pingback]
"http://freewebs.com/amexa/46/embassy-suites-sacramento.html" (http://freewebs.c... [Pingback]
"http://freewebs.com/amexa/46/apex-financial-management.html" (http://freewebs.c... [Pingback]
"http://freewebs.com/amexa/40/woman.html" (http://freewebs.com/amexa/40/woman.ht... [Pingback]
"http://pinofranc.homestead.com/00/rv-loans.html" (http://pinofranc.homestead.co... [Pingback]
"http://pinofranc.homestead.com/03/chilis-restaraunt.html" (http://pinofranc.hom... [Pingback]
"http://pinofranc.homestead.com/05/raleigh-nc-real-estate.html" (http://pinofran... [Pingback]
"http://r0o5g-xxx.com/dawn-nude.html" (http://r0o5g-xxx.com/dawn-nude.html) [Pingback]
"http://i3o1o-www.com/hovidos.html" (http://i3o1o-www.com/hovidos.html) [Pingback]
"http://pasbeenews.tripod.com/170.html" (http://pasbeenews.tripod.com/170.html) [Pingback]
"http://caploonews.tripod.com/128.html" (http://caploonews.tripod.com/128.html) [Pingback]
"http://maoguunews.netfirms.com/73.html" (http://maoguunews.netfirms.com/73.html... [Pingback]
"http://kjipn-ooo.com/heather-brooke-deepthroat.html" (http://kjipn-ooo.com/heat... [Pingback]
"http://nazlyynews.tripod.com/10.html" (http://nazlyynews.tripod.com/10.html) [Pingback]
"http://wepyv-hhh.com/blow-job-trailers.html" (http://wepyv-hhh.com/blow-job-tra... [Pingback]
"http://h6vcn-xxx.biz/lil-kim-porn.html" (http://h6vcn-xxx.biz/lil-kim-porn.html... [Pingback]
"http://naidu-www.biz/plump-girl.html" (http://naidu-www.biz/plump-girl.html) [Pingback]
"http://ovx5a-eee.com/lezbo.html" (http://ovx5a-eee.com/lezbo.html) [Pingback]
"http://freewebs.com/niret/00/bankofamerica-com.html" (http://freewebs.com/niret... [Pingback]
"http://freewebs.com/amexa/22/johnny-cash-picture.html" (http://freewebs.com/ame... [Pingback]
"http://freewebs.com/amexa/44/index.html" (http://freewebs.com/amexa/44/index.ht... [Pingback]
"http://freewebs.com/amexa/11/citizens-national-bank-of-texas.html" (http://free... [Pingback]
"http://freewebs.com/rimoq/12/money-markets.html" (http://freewebs.com/rimoq/12/... [Pingback]
"http://fkdvh-rrr.com/fetish-ballet-shoes.html" (http://fkdvh-rrr.com/fetish-bal... [Pingback]
"http://unistarkom.ueuo.com/00563-blog.html" (http://unistarkom.ueuo.com/00563-b... [Pingback]
"http://ramambo.nl.eu.org/08/chihuahuas.html" (http://ramambo.nl.eu.org/08/chihu... [Pingback]
"http://ramambo.nl.eu.org/bamboozle.html" (http://ramambo.nl.eu.org/bamboozle.ht... [Pingback]
"http://harum.nl.eu.org/www-disney-online-com.html" (http://harum.nl.eu.org/www-... [Pingback]
"http://rr5fpsc.biz/hot-vagina.html" (http://rr5fpsc.biz/hot-vagina.html) [Pingback]
"http://gavgvih.biz/alyssa-milano-topless.html" (http://gavgvih.biz/alyssa-milan... [Pingback]
"http://xw6t8yk.com/erotic-massage-chicago.html" (http://xw6t8yk.com/erotic-mass... [Pingback]
"http://rrubcia.com/www-horseworld-com.html" (http://rrubcia.com/www-horseworld-... [Pingback]
"http://gero--kom.nl.eu.org/sitemap53.html" (http://gero--kom.nl.eu.org/sitemap5... [Pingback]
"http://freewebs.com/gabeganews/50.html" (http://freewebs.com/gabeganews/50.html... [Pingback]
"http://sanoblog.nl.eu.org/maria-nude.html" (http://sanoblog.nl.eu.org/maria-nud... [Pingback]
"http://sanoblog.nl.eu.org/juicy-asses.html" (http://sanoblog.nl.eu.org/juicy-as... [Pingback]
"http://gmpngp0.biz/mardi-gras-nude.html" (http://gmpngp0.biz/mardi-gras-nude.ht... [Pingback]
"http://tre--blog.nl.eu.org/free-diner-dash-game.html" (http://tre--blog.nl.eu.o... [Pingback]
"http://nasferablog.netfirms.com/368.html" (http://nasferablog.netfirms.com/368.... [Pingback]
"http://lk2iuen.biz/free-girl-porn.html" (http://lk2iuen.biz/free-girl-porn.html... [Pingback]
"http://nasferablog.netfirms.com/264.html" (http://nasferablog.netfirms.com/264.... [Pingback]
"http://alo--kom.nl.eu.org/simon--schuster.html" (http://alo--kom.nl.eu.org/simo... [Pingback]
"http://tpoaef7.biz/cleveland-police-department.html" (http://tpoaef7.biz/clevel... [Pingback]
"http://gada--mene.nl.eu.org/older-woman-boobs.html" (http://gada--mene.nl.eu.or... [Pingback]
"http://repola--loto.nl.eu.org/game-websites.html" (http://repola--loto.nl.eu.or... [Pingback]
"http://nasferablog.netfirms.com/457.html" (http://nasferablog.netfirms.com/457.... [Pingback]
"http://jmqp7tr.biz/wwwmyspacenow.com.html" (http://jmqp7tr.biz/wwwmyspacenow.co... [Pingback]
"http://hjftsic.biz/bedbathbeyong.html" (http://hjftsic.biz/bedbathbeyong.html) [Pingback]
"http://freewebs.com/fremapblog/sitemap1.html" (http://freewebs.com/fremapblog/s... [Pingback]
"http://freewebs.com/sruone/major-medical-insurance.html" (http://freewebs.com/s... [Pingback]
"http://freewebs.com/sruone/sitemap306.html" (http://freewebs.com/sruone/sitemap... [Pingback]
"http://lopbafrea.homestead.com/125.html" (http://lopbafrea.homestead.com/125.ht... [Pingback]
"http://mernokob.nl.eu.org/guys-wake-up-with-a-boner.html" (http://mernokob.nl.e... [Pingback]
"http://freewebs.com/vuter/12/cable-vision.html" (http://freewebs.com/vuter/12/c... [Pingback]
"http://duter.homestead.com/01/airline-websites.html" (http://duter.homestead.co... [Pingback]
"http://freewebs.com/vuter/01/sitemap19.html" (http://freewebs.com/vuter/01/site... [Pingback]
"http://duter.homestead.com/01/buffalo-airport.html" (http://duter.homestead.com... [Pingback]
"http://freewebs.com/datingblogger/1102.html" (http://freewebs.com/datingblogger... [Pingback]
"http://freewebs.com/datingblogger/887.html" (http://freewebs.com/datingblogger/... [Pingback]
"http://fasxen.netfirms.com/26.html" (http://fasxen.netfirms.com/26.html) [Pingback]

Computers Blogs - Blog Top Sites

Archive
<January 2009>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2009
Benjamin Rush
Sign In
Statistics
Total Posts: 444
This Year: 0
This Month: 0
This Week: 0
Comments: 128
Themes
Pick a theme:
All Content © 2009, Benjamin Rush
DasBlog theme 'Business' created by Christoph De Baene (delarou)