Reputation: 1499
I need to connect Dynamic Ax
using JAVA
only.
I've gone through many blogs and articles, but it didn't able to do the trick.
See the structure,
Here is the generalize way(Or the way which we are doing) to connect and fetch data from dynamic AX
Something more in C# code
It uses AxaptaObject
(Application connector) and AxaptaContainer
(Data container) from loading Dynamic AX business connector
(DLL file).
Now the question is,
JNI
can we have above axapta
object in java
, by loading Dynamic Ax connector DLL file
? (I hope not)returnsPOJO like object
function ( Accepts method name of AX
, Method parameter
) { //fetch 'AxaptaObject', process method and respond to client(Kind of reflection in JAVA)
DLL file
for above function and access the same using JNI
.The thing is that we have written business logic in AX, but now some how we need to migrate C#
code to JAVA
.
Upvotes: 0
Views: 1451
Reputation: 1
It is possible to make a webservice in Java. You can create a c# client of the Java webservice. And you can access the dll of the c# client from Dynamics Ax.
Upvotes: 0
Reputation: 3097
Web services is the way to go. You can natively develop WPF services in AX 2012 and you can manualy develop them in Visual Studio and connect to AX via Business Connector if you use AX 2009.
There is not and I'm prety sure there won't ever be a way to connect directly to AX from Java other than some kind of web services. Business Connector is discontinued for .NET so don't expect other versions at all.
Upvotes: 1
Reputation: 4400
Using JNI can we have above axapta object in java, by loading Dynamic Ax connector DLL file ? (I hope not)
No, probably not directly.
Can we write some dynamic C# code(Standalone C# program) like, returnsPOJO like object function .... And then create a DLL file for above function and access the same using JNI.
Kind of, you cannot pass some C# object to Java directly but you should be able to create a JNI wrapper for some C# dll and link it all together. I would recommend creating a stand alone DLL that has some uniform interface for interacting with AX to accomplish what you need. You can do all of your testing with a native executable and working out your bugs before you get too deep in the JNI portion. The reason for doing this is debugging JNI problems is a nightmare, and if you are going to be jumping around from your native code into the JVM and then into the .NET framework, debugging is going to be next to impossible. After you are satisfied that your library is functioning correctly, create a JNI (or even JNA) wrapper for your new .NET native lib and basically just use your library and translate the results to Java objects in native code.
Do microsoft provides some java library to connect Dynamic AX directly ? (Must not!!)
I seriously doubt it. The above mentioned approach assumes that you only want to run this JNI code on .NET supported Windows platforms. If this is not the case, you will need to talk to the backing server via the database directly or some other API based interface. I am assuming the business connector you are talking about here is the part that is implemented in C# or .NET. If that is open source or the protocol it uses to communicate with the server is documented, skip the native code and just re-implement that connector in Java. If not, your only option would be to reverse engineer, and its not going to be pretty.
Upvotes: 2