When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles [1.x] [2.0]
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips
Search

Sections:
Book Reviews
Sample Chapters
Commonly Asked Message Board Questions
Headlines from ASPWire.com
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
Web Hosts
XML Info
Information:
Advertise
Feedback
Author an Article
Technology Jobs



















internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers
ASP ASP.NET ASP FAQs Message Board Feedback ASP Jobs
Print this page.

.Net Developer
Professional Technical Resources
US-WA-Bellingham

Justtechjobs.com Post A Job | Post A Resume

Published: Wednesday, July 04, 2001

Creating Web Services with ASP
By Ramesh Balaji and Scott Mitchell


Web Services in Classic ASP and in ASP.NET
One of the neatest features of ASP.NET is the ease with which developers can create and expose Web services. There are plenty of articles that examine how to create Web services in ASP.NET - this article looks at how to create an consume Web services using classic ASP. For more information on using Web services with ASP.NET be sure to read:

Introduction
In its current state, the Internet is used primarily for email and Web surfing. However, as the number of Web sites and on-line users grow, Microsoft (and a number of other companies, such as Sun, IBM, etc.) are seeing a need for Web services. Microsoft explains Web services and their role in the ASP.NET QuickStarts as: "The Internet is quickly evolving from today's Web sites that just deliver user interface pages to browsers to a next generation of programmable Web sites that directly link organizations, applications, services, and devices with one another. These programmable Web sites become more than passively accessed sites - they become reusable, intelligent Web Services."

This article is not intended to educate its readers on what, exactly, a Web service is, or the technical details of how a Web service works. To learn more about these topics, be sure to check out the following articles:

What this article does intend to cover is how to create a Web service server using Visual Basic 6 and the SOAP Toolkit and how to create a Web service client (a COM object able to access a Web service) and how to have this Web service client used through an ASP page.

Building our Web Service
To build a Web service using Visual Basic 6.0, we will need to do two things:

  1. Create a VB COM component
  2. Use the SOAP Toolkit 2.0 Wizard to create the needed ASP pages and WSDL to allow for a remote client to invoke and use the Web service

For this article we will build a simple VB COM component that exposes only a single method, Add, which takes two numeric parameters, adds them, and returns the result. Specifically, the function's code will be:

Public Function Add(ByVal NumberOne As long, _
                    ByVal NumberTwo As long) As Double
    Add = NumberOne + NumberTwo
End Function

Very simple. Before compiling the project into a DLL, be sure to name the project prjAddServer and the class AddServer. (To learn more about building COM objects in VB6 be sure to read: Writing a COM Object with VisualBasic 6.0.)

SOAP Toolkit Wizard Once we have the VB COM component created, all that remains for creating the Web service is to use the SOAP Toolkit Wizard. Before you can do this, though, you must download the SOAP Toolkit 2.0, a free download from Microsoft. Once you've downloaded and installed this program, you need to run the Wizard; to do this, go to Start/Programs/Microsoft SOAP Toolkit/WSDL Generator. A screenshot of this wizard can be seen to the right.

Let's step through each screen of this wizard. First, you will be asked for the name you'd like to use for the Web service as well as the location of the COM component you'd like to use. For this example, use the Web service name AddServer; in the Local path textbox enter the location of the prjAddServer.dll DLL created by VisualBasic when you built the project.

Select which methods you'd like to make available via a Web service call. On the next screen you will be asked what methods you wish to make accessible via a Web service call. Since we only have a single method (Add), make it accessible by checking the method name. Note the screenshot of this stage of the wizard on the left.

On the next screen, you will be prompted for information on the listener. The listener is a process, which is going to listen to the incoming client requests for the Web service, and is responsible for calling the appropriate COM components and returning the results back to the client. In this screen, specify the URL (I used http://localhost/ for this example, but you should probably create a separate directory and use http://www.yourserver.com) and specify that we want the listener to be an ASP page (not an ISAPI DLL). Also, go ahead and leave the XSD Schema Namespace as 2001.

Finally, we need to specify the character set to be used by the Web service, which can be UTF 8.O, or UTF 16.0. If you want to support Unicode usage, select UTF-16, else use UTF-8. Lastly, you need to specify the directory to place the .asp, .WSDL and .wsml files. You should specify a Web-accessible directory here, such as C:\Inetpub\wwwroot\, or whatever physical path maps to your Web site.

Now that we've created our Web service, anyone can access it if they know it exists. Of course, creating a component to access a Web service requires some special syntax, which we'll examine in Part 2. Before we do that, though, we'll take a look at the files created by the SOAP Toolkit wizard and what purpose they serve.

  • Read Part 2!


    Windows Internet Technology | ASP.NET [1.x] [2.0] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article

  • internet.comearthweb.comDevx.commediabistro.comGraphics.com

    Search:

    Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

    Jupitermedia Corporate Info

    Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
    Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

    Whitepapers and eBooks

    Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
    IBM Solutions Brief: Go Green With IBM System xTM And Intel
    HP eBook: Simplifying SQL Server Management
    IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
    Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
    Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
    Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
    Intel PDF: Quad-Core Impacts More Than the Data Center
    Intel PDF: Virtualization Delivers Data Center Efficiency
    Go Parallel Article: PDC 2008 in Review
    Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
    Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
    Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
      PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
    Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
    Go Parallel Article: Q&A with a TBB Junkie
    IBM Whitepaper: Innovative Collaboration to Advance Your Business
    Internet.com eBook: Real Life Rails
    IBM eBook: The Pros and Cons of Outsourcing
    Internet.com eBook: Best Practices for Developing a Web Site
    IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
    Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
    IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
    Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
    HP eBook: Guide to Storage Networking
    MORE WHITEPAPERS, EBOOKS, AND ARTICLES