Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Secure Web Services via TCP/IP

, 30 May 2003
Describes an approach for delivery of Soap Messages serialised using ASP.NET Web Client Services over TCP/IP
wsaltroute2.zip
ArgosAPIExtensions
Bin
Client
ArgosAPIExtensions.dll
WSAltRouteTest.exe
WSIPTransports.dll
Server
WebServices
WSAltRouteArgos
bin
ArgosAPIExtensions.dll
ArgosAPIExtensions.pdb
WSAltRouteArgos.dll
WSAltRouteArgos.pdb
Global.asax
WSAltRouteArgos.csproj.webinfo
WSAltRouteArgos.vsdisco
WSAltRouteBEFake.exe
WSAltRouteTest
App.ico
Web References
ArgosTrinketService
Reference.map
Service1.disco
Service1.wsdl
WSAltRouteBEFake
App.ico
WSAltTransports2
WSQTransports.dll
AsyncHelper.dll
using System;
using System.Web.Services.Protocols;
using Microsoft.Web.Services;


namespace WSAltTransports
{
	/// <summary>WSAltTransports.MyWSESoapClientProtocol</summary>
	/// <author>SGregory</author>
	/// <date>16 January 2003</date>
	/// <remarks>
	/// This class derives from the <code>Microsoft.Web.Services.WebServicesClientProtocol</code>
	/// and allows us to bridge the gap between a Soap Extension and our choice of derived
	/// WebRequest class - both have access to this instance, hence it's a good
	/// way to pass the Soap serialised message for access by the WebRequest-derived
	/// class.  It also holds the ResponseUri, allowing the caller of the generated
	/// proxy class to alter it.
	/// </remarks>
	public class MyWSESoapClientProtocol : Microsoft.Web.Services.WebServicesClientProtocol, ISoapClientProtocol
	{
		/// <summary>WSAltTransports.MySoapClientProtocol.ResponseUrl</summary>
		/// <value>
		/// Read / Write Property supporting the idea of a response Uri on which the
		/// Service should call back on.
		public string ResponseUrl
		{
			// Here we can make use of the kename / value pair bag provided by the WSE
			// We shall use it in this instance to store the response Url.
			// Contrast this approach with that taken in the non-WSE version of this class
			// (MySoapClientProtocol), whcih is forced to use a private member data variable
			// to hold the return Url.
			get
			{
				// Retrieve the Url from the WSE Conext bag
				string strResponseUrl = string.Empty;
				if (this.RequestSoapContext.Contains("ResponseUrl"))
					strResponseUrl =  (string)this.RequestSoapContext["ResponseUrl"];
				return strResponseUrl;
			}
			set
			{
				// Store the Url using the WSE Conext bag
				if (this.RequestSoapContext.Contains("ResponseUrl"))
					this.RequestSoapContext.Remove("ResponseUrl");
				this.RequestSoapContext.Add("ResponseUrl", value);
			}
		}


		/// <summary>WSAltTransports.MyWSESoapClientProtocol.FormatCustomUri</summary>
		/// <author>Simon G</author>
		/// <date>18 February 2003</date>
		/// <remarks>Given a candidate Uri, formats it to an acceptable level for Uri parsing</remarks>
		/// <param name="ProposedUri" type="string">Proposed Uri string requiring formatting</param>
		/// <returns type="string">Uri-friendly version of the string</returns>
		public string FormatCustomUri(
			string ProposedUri)
		{
			// Stop situations where clients primed us with a null (typcailly Response) Uri
			return (ProposedUri != null) ? ProposedUri.Replace("\\", "/") : string.Empty;
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Simon Gregory
Web Developer
United Kingdom United Kingdom
I am the Technical Director for Myphones.com, which specialises in developing integrated VoIP products and services for the consumer and SME markets. Technology-wise, we are heavily into the 2nd generation WS stack atop .NET, and basically most things Microsoft, as well as C++ on Linux.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141223.1 | Last Updated 31 May 2003
Article Copyright 2003 by Simon Gregory
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid