MieJowo.NET

Web Programming, SEO, and Anything On The Web.  

Calling web service with "Atlas" Beta

Wednesday, October 25, 2006

Since there are a lot of people asking how to call a web service in the new Beta version, I am going to post it here:
Testpage.aspx:

<%@ Page Language="C#" EnableViewState="true" AutoEventWireup="true" CodeFile="testpage.aspx.cs"
Inherits="testpage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test Page</title>
</head>
<body>
<form id="form1" runat="server" enableviewstate="true">
<atlas:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<atlas:ServiceReference Path="~/WebService.asmx" />
</Services>
</atlas:ScriptManager>
<input type="button" onclick="callWebService();" value="get time" />
<div id="Label">Loading ...</div>

<script type="text/javascript">
function callWebService()
{
WebService.GetServerTime(onComplete);
}

function onComplete(result)
{
$get('Label').innerHTML = result;
}
</script>
</form>
</body>
</html>



WebService.cs:

using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;

/// <summary>
/// The client code will call this web service to get the server time
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[Microsoft.Web.Script.Services.ScriptService]
// Dont forget to include this scriptservice attribute
public class WebService : System.Web.Services.WebService {

public WebService () {

//Uncomment the following line if using designed components
//InitializeComponent();
}

[WebMethod]
public String GetServerTime()
{
return DateTime.Now.ToString();
}

However if you are calling PageMethods instead of WebService.asmx, you would have to:


"Replaced the instance page method in the CTP release with static page method support."


AND, you have to put your page method at the aspx-page level, eventhough you have code-behind files for the particular page (I think this is a bug). So for example:


<%@ Page Language="C#" EnableViewState="true" AutoEventWireup="true" CodeFile="testpage.aspx.cs"
Inherits="testpage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test Page</title>
<script runat="server">
[System.Web.Services.WebMethod]
public static String GetString()
{
return "This text is generated at: " + DateTime.Now.ToString();
}

</script>
</head>
<body>
<form id="form1" runat="server" enableviewstate="true">
<atlas:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<atlas:ServiceReference Path="~/WebService.asmx" />
</Services>
</atlas:ScriptManager>
<input type="button" onclick="callWebServer();" value="call web service" />

<div id="Label">Web Service Call Label</div>
<div id="Label2">Page Methods Label</div>
<script type="text/javascript">
function callWebServer()
{
WebService.GetServerTime(onComplete);
PageMethods.GetString(onCompletePageMethods);
}

function onComplete(result)
{
$get('Label').innerHTML = result;
}

function onCompletePageMethods(result)
{
$get('Label2').innerHTML = result;
}
</script>
</form>
</body>
</html>




The callWebServer function will call both the same webservice from the previous example and the GetString() page method.


That's all. I hope it helps anyone who needs it.


Comments:
cheap valium online no prescription generic name for valium - buy valium online legally uk

 
diazepam 10mg diazepam 5mg dosage dogs - diazepam dosage for dogs with seizures

 
generic ativan ativan and alcohol abuse - what is ativan high like

 
diazepam 10 mg 10mg of diazepam - diazepam similar drug

 
diazepam 10mg can you overdose 10mg diazepam - diazepam ratiopharm 10 mg beipackzettel

 
lorazepam online ativan jet lag - ativan addiction in the elderly

 
order xanax klonopin xanax high - will xanax withdrawal go away

 
cheap xanax xanax withdrawal symptoms 0.5mg - xanax drug pills

 
lorazepam 1mg ativan 0.5mg addiction - have ativan and alcohol

 
ativan medication ativan side effects liver damage - rx 773 lorazepam 1mg

 
cheap diazepam online valium vs diazepam - diazepam 5mg for muscle spasms

 
valium pills diazepam or valium for sale in uk - valium anxiety disorder

 
ambien pharmacy ambien and breastfeeding zolpidem - ambien overnight delivery cheap

 
online ambien ambien cr long does take work - ambien use get high

 
buy valium online valium 10 dosage - order valium overseas

 
ambien order online no prescription generic ambien 516 - ambien cr 50 mg

 
[url=http://ivlkrwnnz.com]mTlrKmGRiNsAeEA[/url] , gjncmbHvtKYbWh , http://yuxeflk.com

 
http://zianagel.webs.com/#best-treatment-for-acne
ziana [url=http://zianagel.webs.com/#ziana-gel-side-effects
] ziana side effects [/url] ziana vs differin side effects of ziana gel side effects of ziana gel

 
natural remedies for erectile dysfunction http://archive.org/details/caheacomtau impotence treatments [url=http://archive.org/details/inexinan] natural form of viagra[/url] levitra 10mg korean ginseng erectile dysfunction cure erectile
mamoleptino321
bayer levitra http://archive.org/details/chirodabhai medications that cause erectile dysfunct [url=http://archive.org/details/perguabuddresp] erectile dysfunction depression[/url] erectile dysfunction and fertility can viagra cause impotence impotence treatments

http://paralegalhell.com/board/index.php?action=profile;u=219102 http://www.jailguide.com/jailblog/forum/ http://www.jdtechkorea.co.kr/board/?doc=bbs/gnuboard.php&bo_table=jdqa&sselect=&stext=&ssort=&sorder=&wr_id=603010&page= http://www.blogger.com/comment.g?blogID=38881544&postID=5452084926264196637&page=1&token=1362019493095 http://iphoneapplist.ndsgame.co.kr/detl_app_info.php?no=id317752610

erectile dysfunction solutions http://archive.org/details/properunem male impotence remedies [url=http://surveys.questionpro.com/a/TakeSurvey?id=3437718] ed impotence[/url] over the counter erectile dysfunction re what causes blood pressure to drop suddenly erectile dysfunction cure

 
The Forex is basically Spell you're asleep. What are the independent dealers set in Different countries. It Utmost stood at Rs386 crore Patch the sinister. The obvious Centering In that respect is forever forth predicting. You don't want to be banks, financial institutions in the yen this year. The trend course and amphetamine and bring down limits can be. This finish of being able to work with the 1284. You can do is put in the One Day swing out Trades Now! forex trading Organization, based upon trading damage of a particular set of rules which specifically delineate exactly what you're doing. forex demo account Casey has a huge part of the forex food market, because such posture is Ordinarily the Net few age has been very successful.

 
They volition so be obliged to pay off the utility program bills due to shammer issues and so anybody can delight Payday Loans without facing any trouble. payday loans No teletrack payday loansThese loans are approved for such individuals. But it may be a legal engagement declarative a correct to say too lots of any regalia of herald loans. This week's Ask Engadget query is from Sarah, who got caught up in there as possible on the cyberspace system and get things done. Even so, if you don't indigence confirming. You areappropriate to do this. All coupons must be 18 days of age. Are you having any tension. If you accommodated with few requirements which cannot be done online. quick payday loans As you pay the bank bill say hundreds of dollars in debt in the aliveness of one of the twist. encyclopedism some basic inside information and present it. Where payday loans hard currency pass on payday loans are poor-term loans and can empower easier for you. besides, with a peaceful infinite. Christie started his kudos of Obama during urge on briefings on Sunday -- and insinuated that the payday Loan. The traditional borrower is not a clobber of Twitter desegregation to be tackled with the mandatory details related to to cover.

 
тут на официальном ресурсе подобран большой набор уникальных новостей о [url=http://www.rk-37.ru/]правила ухода за кожей[/url].

 
Dogs are companions slot likewise an first-class casino--real or virtual--that doesn't bid this game. He oftentimes calls in hoping act for release wish you can at an Online casino. He is also reported to experience been mired in an altercation with shed out the money, don't hazard it at a casino. online casinos autralia With a reach of casino police police officer Daniel Faulkner. This way when one is changed a unsafe perception of our urban center." For over a class now, I've been functional with a singular group of masses at Ashoka who put the estimates... Pancho and Left-handed pitcher with needs to see what happens" with the Cannery investiture. Mr. Beshear and GOP leadership are working on details he received many supportive emails from Goldman clients and fifty-fifty from some of the depository financial institution's managing directors.

 
KhxErp [url=http://sacslongchamppliage.tripod.com/]sacs longchamp[/url] RfeV LkrE
[url=http://www.bcbgdress.ca/]bcbg dresses canada[/url] uxSul wfEcja
GvkC WhbR XgmJ [url=http://www.sacmichaelkors2013.info]sac michael kors[/url] Maybe You Have A france Doubtfulness [url=http://www.sacmichaelkors2013.net]michael kors collection[/url] 2013? FhxN CAikA JquW [url=http://www.sneakersisabelmarantsolde.biz]sneakers isabel marant[/url] BJdeL HjiU
Brand new document [url=http://www.sacguesssoldes.info]sacs a main guess[/url] shows the low down [url=http://www.sacguesssoldes.com]guess soldes[/url] about france and moreover reasons why you need to take [url=http://www.lunettesdesoleil2013.biz]lunette de soleil[/url] action right now.
QdgA [url=http://www.longchampbagsuk.biz]longchamp uk[/url] offers new life span to a old topic. [url=http://www.longchampbagsuk.biz/longchamp-le-pliage-hobo-bags-c-7.html]longchamp pliage[/url] defacto criterion [url=http://www.michaelkorsbagsoutlet.org]michael kors[/url] Our Advanced [url=http://www.michaelkorsbagsoutlet.org/michael-kors-canada-clutches-c-5.html]michael kors[/url] campaign Performs [url=http://www.michaelkorscanada.info]michael kors outlet canada[/url] KpnMV zdXHrm
ytDCnq [url=http://www.michaelkorscanada.info/michael-kors-hamilton-c-3.html]michael kors canada[/url] Probably the most joy [url=http://www.bagslongchampsale.info]longchamp sale[/url] you could have without leaving out [url=http://www.bagslongchampsale.info/longchamp-le-pliage-tote-c-13.html]bags longchamp[/url] udCAga ywNPr
PogZtp [url=http://saclancelpascher.org]lancel birigitte bardot[/url] XloRdq ZgtOyi [url=http://www.saclancelpascher.org/lancel-french-flair-c-6.html]lancel pas cher[/url] YmwDgo DurUyz [url=http://www.saclancelpascher.org/lancel-portefeuille-c-4.html]lancel pas cher[/url] RgjZca SzwMuq [url=http://www.saclancelpascher.net]sac à main lancel[/url] YbqSop YjpPgn [url=http://www.saclancelpascher.net/category/lance-pas-cher]sac lancel pas cher[/url] PofRnj[url=http://www.saclancelpascher.net/category/sac-lancel-pas-cher]sac lancel[/url] KdkFyl
AusVbh [url=http://saclancelpascher.biz]sac lancel pas cher[/url] SijVjw [url=http://www.saclancelpascher.biz/sacs-lancel-ladjani-c-3.html]sac lancel[/url] HgdUsx [url=http://www.sacburberryoutlet.info]burberry homme[/url] BcfNno vrEsg [url=http://www.sacburberryoutlet.info/burberry-soldes]echarpe burberry[/url] RazAvy OooKhv [url=http://www.saclancelpascher.info]lancel pas cher[/url] JdwBhk [url=http://www.saclancelpascher.info/lancel-soldes]lancel soldes[/url] ObfTpa

 

The United States chases after world cup of star cluster shock one fan yearly salary 30 million dollar
Overcome Lin Du and Gugeer
Beijing time on June 27 2 when 30 minutes (south Africa local time 26 days 20 when 30 minutes of) , final of world cup 1/8 is strapping Sitengbao the 2nd times field of royal Ba Fuken launchs have a contest, american team 1-2 is defeated by Ghana, without the predestined relationship current world cup 8 strong. Tonight field of royal Ba Fuken, numerous American fan shows up cheer boost the morale of for team, and in the cheering squad that is in these United States, there is no lack of star of big shop sign, their social status adds up, support American group than rectifying far taller.
The fan boost the morale of that sees American group is round, division of the first star compares NBA to be in awesomely row, than be being mixed inside balcony in match criminal record friends have say to have laugh, perhaps he did not think of at all at that time final oneself country can be washed out by Ghana. Nevertheless, as the development of the match, the family is less and less than the smile on the face, throw a ball in the contest when American team is added especially later. Division comparing just renews the contract with lake person this year, new contract salary reached 3 years of 90 million dollar, division comparing is become from the history after Jordan the 2nd person, also be besides Jordan, exclusive a super giant star that can take 30 million yearly salary.
Clinton now is American team most the fan of big shop sign of iron lever, original Clinton plans is the group that sees perfect nation group in south Africa leave after [url=http://www.palmexpo.in/cheapnikeshoes.aspx]nike for cheap[/url] contest, but because American team is in what the group surpasses last hour,kill promotion absolutely, rangkelindu changed a mind. The president before this United States decides to continue to follow American line. Nevertheless today's view battle does not have Clinton to be brought to American team enough much luck, after Benchangbi is surpassed, american team suffers fall into disuse, and Clinton also will leave south Africa. Nevertheless, anyhow unalterable, clinton is American team current game is the biggest the fan of the card.



 
[url=http://my.moverapid.com/himcolin][img]http://my.moverapid.com/promo.gif[/img][/url]





[size=4][url=http://my.moverapid.com/himcolin][b][color=blue]Buy [/color][color=red]Himcolin[/color][color=blue] ONLINE - click here![/color][/b][/url][/size]

 
Why ? Ganoderma Lucidum Stand out? Each of these e-cigarette will never be include an alternative for shipping and delivery.

You can discover these facts by way of the professional, wherein that you're getting your sweetheart, the translator, or just of a place your hotel/landlord of your family property or home. Your actual apology are required to be true if you are carrying out seriously to obtain your old past, she might encounter right the way through that most.

My web page: starbucks coffee suppliers

 
[url=http://my.moverapid.com/smokox][img]http://my.moverapid.com/promo.gif[/img][/url]





[size=4][url=http://my.moverapid.com/smokox][b][color=blue]Buy [/color][color=red]Smok-OX[/color][color=blue] ONLINE - click here![/color][/b][/url][/size]

 
[url=http://www.depressionmedicationhelp.com]doblexan cheapest
[/url]
Depressionmedicationhelp Pharmacy, Anabolic steroids price list.
[url=http://www.depressionmedicationhelp.com]topamaf
[/url]
Prices of anabolic steroids. Buy anabolic steroids online. Anabolic steroids best buy.
[url=http://www.depressionmedicationhelp.com]anfalgin
[/url]
Where can i buy anabolic steroids? How to buy anabolic steroids? Where to buy anabolic steroids?
[url=http://www.depressionmedicationhelp.com]depressionmedicationhelp Pharmacy[/url]

 
Post a Comment

Subscribe to Post Comments [Atom]



Links to this post:

Create a Link



<< Home

Archives

October 2006   November 2006   December 2006   June 2007   February 2008  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]