Web Services - Server To Server With SOAP

By Robbe D. Morris

Printer Friendly Version

Robbe Morris
Robbe & Melisa Morris


This article is the sequel to the original article entiled Web Services - Server To Server With XMLHttp.  It's purpose was to demonstrate how to send and retrieve XML over the internet.  Contained within it are a couple of examples including straight XML or ADO recordset generated XML.  I wanted to simplify the whole notion of web services so I left out the SOAP portion.  I would strongly recommend reading the article first as it discusses what Web Services are and potential uses.  We'll not be covering that topic in today's article.

Web Services - Server To Server With XMLHttp
 


 
We just recently opted to make NullSkull.com's content library available via a web service.  This would allow other web sites to include our links and potentially generate more traffic to the site.  So, we needed an efficient way to allow others to access our data with the least amount of strain on our servers.  Naturally, the topic of using a SOAP web service came up and turned out to be the most logical choice.
As part of the development process, we chose to output our content into separate XML files on the server based on content category.  Our server side portion of the web service would not access the database directly but would instead reference the XML files.  This would enable us to minimize database load averages without having to write something special to restrict the number of times the web service could be called.  For security purposes, we've not included that portion of the code today.  Below is the complete server side portion of the web service.  All of our SOAP messages were validated against Microsoft's SOAP validation kit.  We've also made this available to you as an added convenience by clicking on SOAP Validator in the left side navigation pane.  The client side (your server) portion of the code can be found at:
SOAP Client Side Code Sample


Feel free to take both code samples and use them as guide for developing your own SOAP Web Services.  If you have any questions or comments, feel free to contact me via the information below.

Robbe has been a Microsoft MVP in C# since 2004.  He is also the co-founder of NullSkull.com which provides .NET articles, book reviews, software reviews, and software download and purchase advice.