- wsaltroute.zip
- WSAltRoute
- AsyncUIHelper
- Bin
- Client
- Images
- CD.gif
- Help.gif
- Server
- WSQSetup.exe
- POCColour
- bin
- Debug
- EqosBinaryHelper
- LateBoundVBTest
- obj
- Scraps
- Web References
- C24ColourService0603
- C24ColourService2602
- WebSites
- WSAltRoute
- WSAltRouteWSE
- WSAltQSetup
- App.ico
- AssemblyInfo.cs
- bin
- Debug
- WSQSetup.exe
- WSQSetup.pdb
- obj
- Debug
- temp
- TempPE
- WSQSetup.exe
- WSQSetup.exe.incr
- WSQSetup.pdb
- WSQSetup.projdata
- WSQSetup.projdata1
- MQAX200.dll
- QSetupDriver.cs
- WSQSetup.csproj
- WSQSetup.csproj.user
- WSSetupMQ
- WSAltRoute.sln
- WSAltRoute.suo
- WSAltRouteDemo.snk
- WSAltRoutePerfTest
- bin
- Debug
- obj
- Web References
- C24ColourService0603
- C24ColourService0603WSE
- C24ColourService1703Perf
- WSAltRouteTest
- WSAltRouteTestForm
- bin
- Debug
- Release
- obj
- Debug
- temp
- TempPE
- Release
- temp
- TempPE
- Web References
- C24ColourService0603
- C24ColourService0603WSE
- C24ColourService0702
- C24ColourService0702WSE
- C24ColourService2201
- WSAltTransports
- WSDLfromC24
- 20030122
- Test
- 20030207
- 20030226
- 20030306
- WSDLfromJT
- wsaltroute_src.zip
|
// --------------------------------------------------------------------------------
// Module: Service1.asmx.cs
// Author: Administrator
// Date: 02 January 2003
// Description: Standard Service (in this case simply serving a HelloWorld API
// and existing only to support WSDL and associated Proxy generation).
// --------------------------------------------------------------------------------
// $Archive: <VSS Path To File>/Service1.asmx.cs $
// $Revision: 1 $ changed on $Date: 02 January 2003 19:05 $
// Last changed by $Author: Administrator $
// --------------------------------------------------------------------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics; // For Event Logging
using System.Data;
using System.Runtime.InteropServices; // For the COM interface definition and AutoDual
using System.Web;
using System.Web.Services;
using System.IO;
using System.Drawing; // Images etc.
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
// --------------------------------------------------------------------------------
// Namespace: WSAltRoute
// Author: Administrator
// Date: 02 January 2003
// Description: Encapsulates the aleternative route for a Soap Message
// --------------------------------------------------------------------------------
namespace WSAltRoute
{
[Serializable()]
public class Colour1
{
public string code;
public string description;
public string longdescription;
public bool isActive;
[NonSerialized()]
public bool isInProduct;
public Colour1()
{
code = "RED";
description = "Red";
longdescription = "Lucious red";
isActive = true;
isInProduct = true;
}
}
/// <summary>WSAltRoute.Service1</summary>
/// <author>Administrator</author>
/// <date>02 January 2003</date>
/// <remarks>Class for simple HelloWorld service</remarks>
public class Service1 : System.Web.Services.WebService
{
public Service1()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}
#region Component Designer generated code
//Required by the Web Services Designer
private IContainer components = null;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
#endregion
/// <summary>WSAltRoute.Service1.HelloWorld</summary>
/// <author>Administrator</author>
/// <date>02 January 2003</date>
/// <remarks>Basic Hello world message</remarks>
/// <param name="name" type="string">Name of person to say Hi to</param>
/// <returns type="string">Return string saying Hi</returns>
[WebMethod]
public string HelloWorld(string name)
{
return "Hello World of " + name + "HTTP";
}
[WebMethod]
public string[] HelloWorldArr(string name)
{
string[] arrRes = new string[4];
arrRes[0] = "Hello";
arrRes[1] = "World";
arrRes[2] = "of";
arrRes[3] = name + "HTTP[Arr]";
return arrRes;
}
[WebMethod]
public byte[] ReturnImage()
{
byte[] bytImage = null;
Bitmap newBitmap = null;
Graphics g = null;
try
{
// Create a bitmap on the fly
newBitmap = new Bitmap(80,60,PixelFormat.Format32bppArgb);
g = Graphics.FromImage(newBitmap);
g.FillRectangle(new SolidBrush(Color.Aquamarine), new Rectangle(0,0,80,60));
// Read a file
MemoryStream msImage = new MemoryStream();
// Save image to stream
newBitmap.Save(msImage, ImageFormat.Gif) ;
msImage.Position = 0;
// Now load to a byte array for transport
bytImage = new byte[msImage.Length];
msImage.Read(bytImage, 0, bytImage.Length);
msImage.Close();
}
catch(Exception)
{
// Just supress it
}
finally
{
// Note well: Must dispose of graphics object
// before disposing of the bitmap
// Dispose of the graphics object we created
// as its no longer needed
if (null != g)
{
g.Dispose();
}
// Typically we'd dispose of the bitmap here
if (null != newBitmap)
{
newBitmap.Dispose();
}
}
return bytImage;
}
[WebMethod]
public void SendImage(byte[] bytImage)
{
FileStream fs = new FileStream("C:\\Temp\\SendImageHTTP.gif", FileMode.Create);
fs.Write(bytImage, 0, bytImage.Length);
fs.Close();
}
[WebMethod]
public Colour1[] ReturnColours(int vintHowMany)
{
Colour1[] arrColours = new Colour1[vintHowMany];
for (int i = 0; i < vintHowMany; i++)
{
arrColours[i] = new Colour1();
arrColours[i].code = arrColours[i].code + i.ToString() + "HTTP";
}
return arrColours;
}
}
}
|
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.
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
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.