Home arrow XML arrow Page 2 - 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 - Testing the web service with built-in mini web server
(Page 2 of 4 )

This is a functioning web service. If a client calls this web service by sending two arguments, a and b to it, the service will return the result of adding a to b and send the result to the client. You may run this program after saving the file by clicking the little blue arrow in the main menu of ASP.NET Web Matrix. You can recognize this by placing the mouse over this blue arrow. You should see a pop-up showing "Start." When you click this arrow, the following window pops up.

The default radio button option will open up a mini-web server (I believe it is called Cassini) with the port set to 8899. You may change this port if you want. The mini web server can only have web pages from the local machine created in Web Matrix.

The other radio button will create a virtual root on your IIS, assuming you have one. With this you may be able to write a client to consume the web service created in Web Matrix. If you click on the Start button in the above window, you will see the following displayed in your browser. Notice that the URL is that of the mini web server, http://localhost:8899/test.asmx. The service name is the same as the class name. The method Add () is shown as a hyperlink. The Service Description is another hyperlink on this display. The page is truncated to conserve space, but at the very bottom of the page there are hyperlinks giving you access to the various standards that make this web service possible. If you are planning to work with web services it is recommended that these should be reviewed.

If you now click on Add, your browser will display the following page. In this page you may test the functionality of your web service.

If you insert values for a=3 and b=4 and click Invoke, the method will be invoked passing these values, and the resulting display returns the value as shown in an XML format. This is just for testing the service locally. This is not how it will be used in practice. In practice, the client (aka consumer of the service) sends the values a and b through some mechanism. This mechanism may be a web page, a Windows form, or some type of message. The service will return a suitable response after processing.

Now you click on the other hyperlink, Service Provider. You will get a screen full of information about this web service with the URL pointing to: http://localhost:8899/test.asmx?WSDL. WSDL stands for Web Services Discovery Language, a protocol that helps with finding the details about a service. This tutorial format is somewhat limited to explain the details. You may notice that the nodes are collapsed and there is a lot of information hidden in the file. You may also review my other article at the ASP FREE site, Encoding/Decoding Web Service which shows how to create a Web Service in Visual Studio 2003.


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