Done!
Finally, it works.
I followed this tutorial and find the problem.
I need to use wsdl to generate the cs file first,
then use csc to compile the cs file to dll file,
AND, for the example in tutorial, they HAVE TO BE in bin/ directory! (OR, it will not work!)
Three importent lines:
wsdl.exe /l:CS /n:WService /out:bin/GetSuppliers.cs http://localhost/suppliers.asmx?WSDL
csc /t:library /out:bin\GetSuppliers.dll bin\GetSuppliers.cs /reference:System.dll,System.Data.dll,System.Web.dll, System.Web.Services.dll,System.XML.dll /optimize
< %@ Import Namespace="WService" % > <=no space between "<" and "%"
I'll post what I've learned. use this as my notebook. by markchiang (江奕賢)
2004年1月30日
try microsoft .net for binf7560
test on windows 2000
when trying to install .net sdk download
it want me to install "Microsoft Data Access Components" first. download
I think shangker will like this tutorial
I've tried following example.
------------ save this to http://192.168.111.128/DotNet/test.asmx--------------
<%@ WebService Language="c#" Class="FirstWebService" %>
using System;
using System.Web;
using System.Web.Services;
public class FirstWebService {
[WebMethod]
public string HelloWorld(string lcName) {
return "Hello World, " + lcName;
}
[WebMethod]
public decimal AddNumbers(decimal lnNumber1, decimal lnNumber2) {
return lnNumber1 + lnNumber2;
}
/*
[WebMethod]
public DateTime GetServerTime() {
return DateTime.Now;
} */
}
--------------end of test.asmx------------------
then connect to
http://192.168.111.128/DotNet/test.asmx
you can see things mentioned in this tutorial
if you want WSDL, you can connect to: http://192.168.111.128/DotNet/test.asmx?wsdl
this is the easist way to create web services I've ever seen.
this tool can help you to test it.
test on windows 2000
when trying to install .net sdk download
it want me to install "Microsoft Data Access Components" first. download
I think shangker will like this tutorial
I've tried following example.
------------ save this to http://192.168.111.128/DotNet/test.asmx--------------
<%@ WebService Language="c#" Class="FirstWebService" %>
using System;
using System.Web;
using System.Web.Services;
public class FirstWebService {
[WebMethod]
public string HelloWorld(string lcName) {
return "Hello World, " + lcName;
}
[WebMethod]
public decimal AddNumbers(decimal lnNumber1, decimal lnNumber2) {
return lnNumber1 + lnNumber2;
}
/*
[WebMethod]
public DateTime GetServerTime() {
return DateTime.Now;
} */
}
--------------end of test.asmx------------------
then connect to
http://192.168.111.128/DotNet/test.asmx
you can see things mentioned in this tutorial
if you want WSDL, you can connect to: http://192.168.111.128/DotNet/test.asmx?wsdl
this is the easist way to create web services I've ever seen.
this tool can help you to test it.