콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
20516 화면

Hi,

I am doing some work where I try and connect to the webservice of Odoo 8 through the XML RPC interface.

I am working off the documentation located here: https://www.odoo.com/documentation/8.0/api_integration.html#logging-in

In this documentation it states that the authentication method on the common endpoint returns an integer.. containing the uid. This does not seem to be true... I get a bool as a result.

Anybodý that has succesfully authenticated and recieved an uid? In that case..how?  :-)

아바타
취소
베스트 답변

refer : http://xml-rpc.net/, add reference CookComputing.XmlRpcV2.dll file on your project in c#,


        using CookComputing.XmlRpc;
        [XmlRpcUrl("http://localhost:8069/xmlrpc/common")]
        public interface IOpenErpLogin : IXmlRpcProxy
        {
            [XmlRpcMethod("login")]
            int login(string dbName, string dbUser, string dbPwd);
        }

        private void button1_Click(object sender, EventArgs e)
        {
          
            //Login to openerp
            IOpenErpLogin rpcClientLogin = XmlRpcProxyGen.Create<IOpenErpLogin>(); //add  XmlRpcProxyGen.CS File from src folder if required,
            int userid = rpcClientLogin.login(dbname, userName, pwd);
            MessageBox.Show(userid.ToString());
        }

 

아바타
취소
작성자

Hi Sajn Thank you for your help, but I am doing exactly as you are..except I recieve a bool as response from the login method. My code: public object Authenticate(string username, string password, string database) { var proxy = XmlRpcProxyGen.Create(); proxy.Url = string.Format("{0}{1}", this.Url, Constants.Extensions.Common); proxy.NonStandard = XmlRpcNonStandard.AllowStringFaultCode; return proxy.Authenticate(database, username, password, new string[] { }); } the object returned is a bool, and I have tried doing the same with the login method, with the same result. I try to connect to an instance of Odoo at Odoo.com, and wonder if the webservice has changed, and the documentation has not been updated. Because the documentation describes exactly what you are doing.

작성자 베스트 답변

For reference. My problem was solved reading another post here.. that when creating an instance of a hosted Odoo on Odoo.com, you need to go and change the password of the user, before it actually can be "seen".

Doing that had my code working like a charm.

아바타
취소
베스트 답변

Hi,

we create a mapper for xml-rpc to REST written in C#

https://odoorestapi.azurewebsites.net/Help

 

아바타
취소
작성자

Hi Martin Thank you, I have already seen it, but I am more than capable of coding myself, except for the trouble with a difference between the documentation of Odoo, and the reality. /HH

관련 게시물 답글 화면 활동
1
12월 16
4233
3
3월 15
7119
2
2월 21
7184
2
6월 17
13345
0
1월 16
7122