WebProWorld IT Forum

Using Fdisk command
I need some assistant I'm new using the fdisk command. I would like to reformat my whole hard drive, start clean...so I can install my o/s from scratch...What steps should I follow.
Click to read more...

Internet 2 (Internet II) 100 times faster
Internet Two the second version for the Internet. Internet 2 will be at 100 times the speed of the current Internet. Internet development. Internet the future. Internet Progress.
Click to read more...



Recent Articles

C++ Function Templates
C++ Function templates are those functions which can handle different data types without separate code for each of them.

LM-X License Management Software for C# .NET
X-Formation announced the release of its LM-X license management software for the C# .NET language.

Microsoft CRM Customization: Integration with third party SQL Application/Database
Microsoft CRM - Client Relationship Management package from Microsoft Business Solutions was initially designed to be customizable with Microsoft Visual Studio.Net...


Get a $25 credit with Overture Search Advertising
12.15.04

HTML Client For Web Services Using DHTML Behavior

By Dipal Choksi

In this example we will access a Web Service created in C# from an HTML client. The client does not use .Net Framework directly and instead accesses the Web Service functionality using the DHTML behavior.

Definitions:

Web Services are defined as programmable application logic that is accessible using standard Internet protocols.

DHTML behaviors are components that encapsulate functionality on a page. DHTML behaviors are available in IE5.5 and above. To be able to use the behavior in a Web Page in IE5.5, you will need to download the WebService.htc behavior file and save it in the same folder as your html page. The file can be downloaded from the following location: http://msdn.microsoft.com/downloads/samples/internet
/behaviors/library/webservice/webservice.htc

Program Details

Let's delve into the details of our program.

Step 1: Create the Web Service

Create the file that exposes our Web Service function using your favorite text editor or Visual Studio.Net. Shown below is the code for the Web Service.

<%@ WebService Language="C#" class="TestWS" %>
using System;
using System.Web.Services;
using System.Web.Mail;

[WebService] public class TestWS : System.Web.Services.WebService
{
[WebMethod] public int Add(int num1, int num2)
{
return num1 + num2;
}
}


Code Listing: Save as TestWS.asmx

The web service "TestWS" is very simple - it exposes only one function "Add" which accepts 2 integers as input and returns their sum as the output.

Get Hundreds of Incoming Links - Instantly ->> more info

Step2 : Create the HTML Client

First we specify the web service behavior in the html file as follows
<div id="service" style="behavior:url(webservice.htc)" onresult="onWSresult()">
</div>

The id specified for this element to reference the element in script.

Next we map the web service URL to a user-friendly name ("Calculator" in this case).
We add this code in the OnLoad handler for the page to ensure that the web service is mapped before any methods are invoked on the web service.

service.useService ('http://localhost/site/ code/testws.asmx?WSDL','Calculator');

Now that the webservice is setup for access, we invoke the web service methods asynchronously in two steps. The advantage of asynchronous invocation is that the web page does not have to keep waiting for the web service to return. In the first step, the web method is invoked. A call back function is specified and when the web service completes execution, the callback function gets executed. As a second step, the call back function (or an "onresult" event, if no callback function is specified) gets fired when the web service returns after execution or a timeout error occurs.

The code to actually invoke the Web Service's web method is shown below. The web method is invoked when the "Add Numbers" button is clicked.

The input parameters to the callService method are "methodname" and the input parameters expected by the web service.

Read the Rest of the Article.


About the Author:
Dipal Choksi is a Bachelor of Engineering (Computer Science). She has industry experience in team-effort projects and also as an individual contributor. She has worked on Visual Basic, Visual C++, Java, Directory Services, ASP projects

About CProgrammingTrends
A collection of articles and tutorials designed to help C and C variant programmers in their programming work. C Programming Tutorials and advice

CProgrammingTrends is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com ITmanagmentNews.com

-- CProgrammingTrends is an iEntry, Inc. publication --
iEntry, Inc. 880 Corporate Drive, Lexington, KY 40503
2004 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal


archives | advertising info | news headlines | free newsletters | comments/feedback | submit article



">Unsubscribe from CProgrammingTrends.
To unsubscribe from CProgrammingTrends or any other iEntry publication, simply send an email request to: support@ientry.com
C Programming Tutorials and advice CProgrammingTrends News Archives About Us Feedback CProgrammingTrends Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact