[Mono-devel-list] Test Web Services
Leos Urban
Leos.Urban at qds.cz
Sun Oct 5 13:19:25 EDT 2003
Test this:
mkdir /xsp/bin
mkdir /xsp/SoapExample
create CS (csharp) source file SoapExample.asmx.cs (see code bellow)
mcs /t:library /r:System.Web.Services.dll /r:System.Data.dll
SoapExample.asmx.cs
mv SoapExample.asmx.dll /xsp/bin
create ASMX file SoapExample.asmx in /xsp/SoapExample (see bellow)
Test it with:
http://127.0.0.1/SoapExample/SoapExample.asmx?WSDL
if call returns XML / WSDL service definition, then you have functional SOAP
service...
Leos
SoapExaple.asmx:
----------------------------------------------------------------------------
------
<%@ WebService Language="C#" Debug="false" Codebehind="SoapExample.asmx.cs"
Class="cz.qds.soaping.MyTest" %>
SoapExaple.asmx.cs:
----------------------------------------------------------------------------
------
// start of SoapExample.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
namespace cz.qds.soaping
{
[WebService(Namespace="Test", Description="Test")]
public class MyTest: System.Web.Services.WebService
{
public MyTest()
{
}
private IContainer components = null;
private void InitializeComponent()
{
}
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
[WebMethod]
public string About()
{
return "Test";
}
[WebMethod]
public String WhatIsTime()
{
return System.DateTime.Now.ToString();
}
}
}
// end of SoapExample
More information about the Mono-devel-list
mailing list