QueryService qs = new QueryService();
String result = qs.getQueryPort().queryList(String类型的查询报文);
就这段,我自己写了个webservice只能访问到qs.getQueryPort(),再"."后面就没有了,请问如何才能得到queryList()这个方法呢

解决方案 »

  1.   

    不是,Public的
        [WebService(Namespace = "http://tempuri.org/")]
        [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
        [ToolboxItem(false)]
        // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
        // [System.Web.Script.Services.ScriptService]
           
        public class QueryService : System.Web.Services.WebService
        {        [WebMethod]
            public GetPort getQueryPort()
            {
                GetPort g = new GetPort();
                return g;
            }        public class GetPort
            {
                [WebMethod]
                public string queryList(string sXMLParam)
                {
                    return "123";
                }
            }
           
        }
    这是代码