首页 新闻 赞助 找找看

mono webservice问题请教

0
悬赏园豆:100 [已关闭问题] 关闭于 2013-02-18 08:53

各位大神,最近在学习mono for android 在vs2010里面调用webservice的项目,目前项目中直接添加web引用是可以正常使用的。但实际运用中,webservice地址有可能会变化,想请教下,如何动态调用webservice。    网上查了常见的几种c#调用webservice方法都不可以使用。查看了mono的system.dll基础类库和framework的system.dll的基础类库不一样,删减了很多,缺少CodeNamespace等。请教各位大神,看有没有什么方法能解决。感谢

以下是代码部分

View Code
        
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name = "WebServiceFactorySoap", Namespace = "http://www.webxml.com.cn/")]
    public class WebServiceFactory : System.Web.Services.Protocols.SoapHttpClientProtocol
    {
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://WebXml.com.cn/getDatabaseInfo",
        RequestNamespace = "http://www.webxml.com.cn/",
        ResponseNamespace = "http://www.webxml.com.cn/",
        Use = System.Web.Services.Description.SoapBindingUse.Literal,
        ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string getDatabaseInfo() 
        {
            try
            {
                this.Url = "http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx";
                Object[] result = this.Invoke("getDatabaseInfo", new Object[0]);
                return result[0].ToString();
            }
            catch (Exception e)
            {
                return e.ToString();
            }

        }
    }
}
问题补充:

URL肯定是可以传的,我的问题是我希望可以通过读取app.config文件相应配置节。

但mono for android好像不识别configutionManager等调用配置节属性

关陈七的主页 关陈七 | 初学一级 | 园豆:107
提问于:2013-02-01 17:09
< >
分享
所有回答(3)
0

传个url不久行了

Firen | 园豆:5385 (大侠五级) | 2013-02-01 17:11
0

你说mono缺少类,你可以试试引用framework的system.dll类,这样就可以用net编程了

angelshelter | 园豆:9887 (大侠五级) | 2013-02-02 16:31
0

mono 用的人太少。遇到问题 只能自己摸索~~·

Fan丶 | 园豆:336 (菜鸟二级) | 2013-02-04 17:58
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册