各位大侠,本人最近在学习asp .net时,在本人的website项目中建立了一个继承自WebService类:MusicCityServices
<%@ WebService Language="C#" Class="Retailer.MusicCityServices" %>
using System;
using System.Data;
using System.Collections;
using System.Web.Services;
using System.Xml;namespace Retailer
{
    [WebService(Namespace = "http://localhost:1587/ASPDataProviderTest/")]
    public class MusicCityServices : WebService
    {
        ........
    }
}
现在本人新建了一个asp页面,我想在该页面的<script runat="server">里面使用类MusicCityServices,不知道怎么调用它,请提示,不胜感激!!!

解决方案 »

  1.   

    本人先回复一下吧,先通过sdk的命令wsdl将相应的webservice转换为一个cs文件,然后将该文件编译成一个dll,然后将该dll加载到本项目的bin目录下面,最后在asp页面导入该文件即可.各位,有没有其他更简单一些方法哪,等待中......
      

  2.   

    对webservice的访问,需要添加web引用,注意不是项目引用,地址栏中选择出你的MusicCityServices的访问地址,添加引用。
    使用的时候就和使用本地一个类一样的方式了。