跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

X

xiaonibaba

@xiaonibaba
关于
帖子
1
主题
1
群组
0
粉丝
0
关注
0

帖子

最新 最佳 有争议的

  • c#.net 调用xmlrpc 的例子
    X xiaonibaba
    <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 />&nbsp; &nbsp; #region 头部定义<br />&nbsp; &nbsp; [WebService(Namespace = &quot;http://BPM/&quot;)]<br />&nbsp; &nbsp; [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />&nbsp; &nbsp; [System.ComponentModel.ToolboxItem(false)]<br /><br />&nbsp; &nbsp; // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。<br />&nbsp; &nbsp; [System.Web.Script.Services.ScriptService]<br />&nbsp; &nbsp; #endregion<br />&nbsp; &nbsp; public class OpenErpRpc_Budget : BPM.WebService.BaseService<br />&nbsp; &nbsp; {<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; [XmlRpcUrl(&quot;http://192.168.168.217:8069/xmlrpc/common&quot;)]<br />&nbsp; &nbsp; &nbsp; &nbsp; public interface IOpenERPCommon : IXmlRpcProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [XmlRpcMethod(&quot;login&quot;)]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int Login(string DB, string USER, string PASS);<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; [XmlRpcUrl(&quot;http://192.168.168.217:8069/xmlrpc/object&quot;)]&nbsp; &nbsp;  <br />&nbsp; &nbsp; &nbsp; &nbsp; public interface IOpenERPObject : IXmlRpcProxy<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [XmlRpcMethod(&quot;execute&quot;)]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; object execute(string dbname, int uid, string pwd, string className, string method, params string&#91;] args);<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; string database = ConfigurationSettings.AppSettings[&quot;xxys_database&quot;].ToString();<br />&nbsp; &nbsp; &nbsp; &nbsp; string user = ConfigurationSettings.AppSettings[&quot;xxys_user&quot;].ToString();<br />&nbsp; &nbsp; &nbsp; &nbsp; string password = ConfigurationSettings.AppSettings[&quot;xxys_password&quot;].ToString();<br />&nbsp; &nbsp; &nbsp; &nbsp; int uid = 0;<br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; public OpenErpRpc_Budget()<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IOpenERPCommon proxy = XmlRpcProxyGen.Create&lt;IOpenERPCommon&gt;();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uid = proxy.Login(database, user, password);<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; [WebMethod(Description = &quot;OPENERP的RPC调用&quot;)]<br />&nbsp; &nbsp; &nbsp; &nbsp; public object Execute(string className, string Method, params string&#91;] args)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IOpenERPObject proxy2 = XmlRpcProxyGen.Create&lt;IOpenERPObject&gt;();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; object ret2 = proxy2.execute(database, uid, password, className, Method, args);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return ret2;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br /><br /><br /><br /><br />&nbsp; &nbsp; }<br />}<br /><br /><br />
    
  • 登录

  • 没有帐号? 注册

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组