Home arrow XML arrow Creating a Web Service with Web Matrix
XML

Creating a Web Service with Web Matrix


The Web Matrix project appears to have served as a test bed in the development of ASP.NET. This freebie attracted a lot of attention since it did not require an installation of IIS. It had its own http server whenever needed. Of course, one could use it also in the presence of an installed IIS. This tutorial is about creating a web service on Web Matrix and testing the service on the built in mini web server, as well as testing a second example on the IIS 5.1 on the local machine.

Author Info:
By: Jayaram Krishnaswamy
Rating: 5 stars5 stars5 stars5 stars5 stars / 6
March 22, 2006
TABLE OF CONTENTS:
  1. · Creating a Web Service with Web Matrix
  2. · Testing the web service with built-in mini web server
  3. · Second example: the Pythagoras Theorem
  4. · Testing this web service

print this article
SEARCH DEVARTICLES

Creating a Web Service with Web Matrix
(Page 1 of 4 )

Create a file of type XML Web Service: Default Example

When Web Matrix starts, click on File -> New File.... The window for adding a new file, Add New File, opens, presenting a number of types of files you can add.  It also shows the folder tree on the right where you can save the file you are adding. Before creating a new file, pick the type of file you want to create. In this case a XML Web Service file is chosen as shown. Since it is a service without any visible controls,  the file will be compiled as a class file and requires a class name, hence give a class name that can be remembered; here it is given the value hteksamples which is arbitrary.

You can give a namespace to collect together a set of related classes. Since there is only one class created here, you may give any name for this; it is given the value HODENTEK. Add New File adds a new web service file, test.asmx file as shown to the C:AspApril04 folder (after you click OK to this window). All web service files will have the extension .asmx. The Workspaces window is where the tree view of folders is shown. Under the Workspaces window you will see the Classes window where all the classes starting from System are shown.

 

When you click OK to the above, the code for the class file you are going to create will open in the code view with a default web service. The service will have a WebMethod having a function name, Add () as shown. This area where you see the code is a text editor where you can make changes. You may notice that all the imports statements have been added by the Web Matrix IDE. You will see the class name we gave is at the very top of this page. The language attribute is 'VB', but you can also use C# or J#.


blog comments powered by Disqus
XML ARTICLES

- Open XML Finally Supported by MS Office
- XML Features Added to Two Systems
- Using Regions with XSL Formatting Objects
- Using XSL Formatting Objects
- More Schematron Features
- Schematron Patterns and Validation
- Using Schematron
- Datatypes and More in RELAX NG
- Providing Options in RELAX NG
- An Introduction to RELAX NG
- Path, Predicates, and XQuery
- Using Predicates with XQuery
- Navigating Input Documents Using Paths
- XML Basics
- Introduction to XPath

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials