XML
  Home arrow XML arrow Page 2 - Creating a Web Service with Web Matrix
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

Creating a Web Service with Web Matrix
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2006-03-22

    Table of Contents:
  • Creating a Web Service with Web Matrix
  • Testing the web service with built-in mini web server
  • Second example: the Pythagoras Theorem
  • Testing this web service

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    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.

    More XML Articles
    More By Jayaram Krishnaswamy


       · Evolution is the key for all processes that includes life forms as well as software....
       · how to use this xml webservices to convert the databases
       · It's [the following link to one of my old articles] not a full blown example from...
     

    XML ARTICLES

    - 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
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek