Gabino A. de la Gala Well-Known Member Licensed User Longtime User May 18, 2024 #1 I am trying to connect to a Business Central database installed on a local server. Currently I am being able to connect directly to the database, but I would like to try to do it using their webservice with oDataV4, which is much more convenient to prepare the queries than doing it directly with SQL since it has tremendously complex table and field names, apart from of the game provided by the Flowfields with which you already get precalculated values that otherwise you also have to calculate manually when launching the standard SQL. Thank you
I am trying to connect to a Business Central database installed on a local server. Currently I am being able to connect directly to the database, but I would like to try to do it using their webservice with oDataV4, which is much more convenient to prepare the queries than doing it directly with SQL since it has tremendously complex table and field names, apart from of the game provided by the Flowfields with which you already get precalculated values that otherwise you also have to calculate manually when launching the standard SQL. Thank you
DonManfred Expert Licensed User Longtime User May 18, 2024 #2 Open Data Protocol - Wikipedia en.wikipedia.org oData is using REST to communicate. you can call it directly with okhttputils. Upvote 0
Open Data Protocol - Wikipedia en.wikipedia.org oData is using REST to communicate. you can call it directly with okhttputils.
josejad Expert Licensed User Longtime User May 19, 2024 #3 Hi: It seems there is a jDBC driver for oData, so, it’s probably you can use it As Erel says in the jRDC2 tutorial: “jRDC2 can work with any database that provides a JDBC driver.” JDBC Driver · OData - the Best Way to REST Connect-to live OData Services services from all kinds of BI, Reporting, ETL, Database, and Analytics tools. With the JDBC Driver users can access OData Serv... www.odata.org Upvote 0
Hi: It seems there is a jDBC driver for oData, so, it’s probably you can use it As Erel says in the jRDC2 tutorial: “jRDC2 can work with any database that provides a JDBC driver.” JDBC Driver · OData - the Best Way to REST Connect-to live OData Services services from all kinds of BI, Reporting, ETL, Database, and Analytics tools. With the JDBC Driver users can access OData Serv... www.odata.org
Gabino A. de la Gala Well-Known Member Licensed User Longtime User May 21, 2024 #4 I am trying to make an application with B4XPages to be able to consume oDATA services from both B4J and B4A and thus be able to make direct requests from mobile devices as @DonManfred recommended. From B4J I have already achieved it, but from B4A, it doesn't give me a compilation error and I can't go from there. The "stuck" that I encounter and that I believe is the origin of the problem is that I have to connect to the service using NTLM authentication. I am doing it following @Erel's instructions from this thread: https://www.b4x.com/android/forum/t...hentication-ntlmv2-solution.66790/post-424367 The error that appears when compiling is: B4X: Copy B4A Versión: 11.00 Parseando código. (0.04s) Java Versión: 8 Building folders structure. (0.03s) Corriendo accion personalizada. (0.99s) Compilando código. (0.05s) Compilado códigos de diseños. (0.01s) Organizando librerías. (0.00s) (AndroidX SDK) Compilando los recursos (0.41s) Enlazando los recursos (0.40s) Compilando el código Java generado. Error javac 1.8.0_201 src\b4a\example\main.java:7: error: package org.apache.http.impl.auth does not exist import org.apache.http.impl.auth.NTLMEngine; ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error Upvote 0
I am trying to make an application with B4XPages to be able to consume oDATA services from both B4J and B4A and thus be able to make direct requests from mobile devices as @DonManfred recommended. From B4J I have already achieved it, but from B4A, it doesn't give me a compilation error and I can't go from there. The "stuck" that I encounter and that I believe is the origin of the problem is that I have to connect to the service using NTLM authentication. I am doing it following @Erel's instructions from this thread: https://www.b4x.com/android/forum/t...hentication-ntlmv2-solution.66790/post-424367 The error that appears when compiling is: B4X: Copy B4A Versión: 11.00 Parseando código. (0.04s) Java Versión: 8 Building folders structure. (0.03s) Corriendo accion personalizada. (0.99s) Compilando código. (0.05s) Compilado códigos de diseños. (0.01s) Organizando librerías. (0.00s) (AndroidX SDK) Compilando los recursos (0.41s) Enlazando los recursos (0.40s) Compilando el código Java generado. Error javac 1.8.0_201 src\b4a\example\main.java:7: error: package org.apache.http.impl.auth does not exist import org.apache.http.impl.auth.NTLMEngine; ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error
DonManfred Expert Licensed User Longtime User May 21, 2024 #5 Gabino A. de la Gala said: import org.apache.http.impl.auth.NTLMEngine; Click to expand... where does this come from? Upload a small project showing the issue. Upvote 0
Gabino A. de la Gala said: import org.apache.http.impl.auth.NTLMEngine; Click to expand... where does this come from? Upload a small project showing the issue.
Gabino A. de la Gala Well-Known Member Licensed User Longtime User May 22, 2024 #6 Here is attached a project with B4XPages. The B4J part compiles and connects to the data source perfectly. However, part B4A gives a compilation error and I can't test anything. If I comment out the #if java condition, then the B4A part also compiles, but cannot access the data source because it does not accept the credentials. Thank you. Attachments NTLM_OData_Project.zip NTLM_OData_Project.zip 16.8 KB · Views: 358 Upvote 0
Here is attached a project with B4XPages. The B4J part compiles and connects to the data source perfectly. However, part B4A gives a compilation error and I can't test anything. If I comment out the #if java condition, then the B4A part also compiles, but cannot access the data source because it does not accept the credentials. Thank you.
Erel B4X founder Staff member Licensed User Longtime User May 22, 2024 #7 Gabino A. de la Gala said: However, part B4A gives a compilation error and I can't test anything. Click to expand... The B4A client only communicates with jRDC2 server. It is not affected by the actual db used. Upvote 0
Gabino A. de la Gala said: However, part B4A gives a compilation error and I can't test anything. Click to expand... The B4A client only communicates with jRDC2 server. It is not affected by the actual db used.
Gabino A. de la Gala Well-Known Member Licensed User Longtime User May 22, 2024 #8 Erel said: The B4A client only communicates with jRDC2 server. It is not affected by the actual db used. Click to expand... And how should the data received be converted into JSON so that the jrdc2 server would return it in a standard way to the Android devices? As far as I know, the jrdc2 server only fetches data hosted in "real" databases, not in json and similar formats. Upvote 0
Erel said: The B4A client only communicates with jRDC2 server. It is not affected by the actual db used. Click to expand... And how should the data received be converted into JSON so that the jrdc2 server would return it in a standard way to the Android devices? As far as I know, the jrdc2 server only fetches data hosted in "real" databases, not in json and similar formats.
DonManfred Expert Licensed User Longtime User May 22, 2024 #9 Gabino A. de la Gala said: As far as I know, the jrdc2 server only fetches data hosted in "real" databases, not in json and similar formats. Click to expand... It fetches the Data from the odbcdriver. If there is a odbcdriver for oData then the data inside the odbcdriver is not json any longer. Using a odbcdriver you don´t have to care about json i guess. I never used oData and even not a OData-odbcdriver. I can´t help in this regard. If you want to work with JSON then you have to use the REST-Api i guess. Upvote 0
Gabino A. de la Gala said: As far as I know, the jrdc2 server only fetches data hosted in "real" databases, not in json and similar formats. Click to expand... It fetches the Data from the odbcdriver. If there is a odbcdriver for oData then the data inside the odbcdriver is not json any longer. Using a odbcdriver you don´t have to care about json i guess. I never used oData and even not a OData-odbcdriver. I can´t help in this regard. If you want to work with JSON then you have to use the REST-Api i guess.