Odoo中文社区可以通过以下三个域名访问:shine-it.net , odoocn.org,odoo.net.cn

原论坛用户的基本信息和发帖这里都予以保留,请注意:原论坛用户无需重新注册新用户,但是您的密码需要重置

开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

如果您登录系统碰到问题,请在微信公众号留言:

c#.net 调用xmlrpc 的例子



  • [code]<br />using System;<br />using System.Collections.Generic;<br />using System.Linq;<br />using System.Web;<br />using System.Web.Services;<br />using CookComputing.XmlRpc;<br />using System.Configuration;<br /><br />namespace BPM.WebService<br />{<br />    #region 头部定义<br />    [WebService(Namespace = "http://BPM/")]<br />    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />    [System.ComponentModel.ToolboxItem(false)]<br /><br />    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。<br />    [System.Web.Script.Services.ScriptService]<br />    #endregion<br />    public class OpenErpRpc_Budget : BPM.WebService.BaseService<br />    {<br /><br />        [XmlRpcUrl("http://192.168.168.217:8069/xmlrpc/common")]<br />        public interface IOpenERPCommon : IXmlRpcProxy<br />        {<br /><br />            [XmlRpcMethod("login")]<br />            int Login(string DB, string USER, string PASS);<br />        }<br /><br />        [XmlRpcUrl("http://192.168.168.217:8069/xmlrpc/object")]    <br />        public interface IOpenERPObject : IXmlRpcProxy<br />        {<br />            [XmlRpcMethod("execute")]<br />            object execute(string dbname, int uid, string pwd, string className, string method, params string[] args);<br />        }<br />        string database = ConfigurationSettings.AppSettings["xxys_database"].ToString();<br />        string user = ConfigurationSettings.AppSettings["xxys_user"].ToString();<br />        string password = ConfigurationSettings.AppSettings["xxys_password"].ToString();<br />        int uid = 0;<br /><br /><br />        public OpenErpRpc_Budget()<br />        {<br />            IOpenERPCommon proxy = XmlRpcProxyGen.Create<IOpenERPCommon>();<br />            uid = proxy.Login(database, user, password);<br />        }<br /><br />        [WebMethod(Description = "OPENERP的RPC调用")]<br />        public object Execute(string className, string Method, params string[] args)<br />        {<br />            IOpenERPObject proxy2 = XmlRpcProxyGen.Create<IOpenERPObject>();<br />            object ret2 = proxy2.execute(database, uid, password, className, Method, args);<br />            return ret2;<br />        }<br /><br /><br /><br /><br />    }<br />}<br /><br /><br />[/code]



  • [code]<br />using System;<br />using System.Collections.Generic;<br />using System.Linq;<br />using System.Web;<br />using System.Web.Services;<br />using CookComputing.XmlRpc;<br />using System.Configuration;<br /><br />namespace BPM.WebService<br />{<br />    #region 头部定义<br />    [WebService(Namespace = "http://BPM/")]<br />    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />    [System.ComponentModel.ToolboxItem(false)]<br /><br />    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。<br />    [System.Web.Script.Services.ScriptService]<br />    #endregion<br />    public class OpenErpRpc_Budget : BPM.WebService.BaseService<br />    {<br /><br />        [XmlRpcUrl("http://192.168.168.217:8069/xmlrpc/common")]<br />        public interface IOpenERPCommon : IXmlRpcProxy<br />        {<br /><br />            [XmlRpcMethod("login")]<br />            int Login(string DB, string USER, string PASS);<br />        }<br /><br />        [XmlRpcUrl("http://192.168.168.217:8069/xmlrpc/object")]    <br />        public interface IOpenERPObject : IXmlRpcProxy<br />        {<br />            [XmlRpcMethod("execute")]<br />            object execute(string dbname, int uid, string pwd, string className, string method, params string[] args);<br />        }<br />        string database = ConfigurationSettings.AppSettings["xxys_database"].ToString();<br />        string user = ConfigurationSettings.AppSettings["xxys_user"].ToString();<br />        string password = ConfigurationSettings.AppSettings["xxys_password"].ToString();<br />        int uid = 0;<br /><br /><br />        public OpenErpRpc_Budget()<br />        {<br />            IOpenERPCommon proxy = XmlRpcProxyGen.Create<IOpenERPCommon>();<br />            uid = proxy.Login(database, user, password);<br />        }<br /><br />        [WebMethod(Description = "OPENERP的RPC调用")]<br />        public object Execute(string className, string Method, params string[] args)<br />        {<br />            IOpenERPObject proxy2 = XmlRpcProxyGen.Create<IOpenERPObject>();<br />            object ret2 = proxy2.execute(database, uid, password, className, Method, args);<br />            return ret2;<br />        }<br /><br /><br /><br /><br />    }<br />}<br /><br /><br />[/code]


登录后回复
 

与 Odoo 中文社区 的连接断开,我们正在尝试重连,请耐心等待