ASP.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a ASP.NET Expert!

Join 300,406 ASP.NET Programmers for FREE! Get instant access to thousands of ASP.NET experts, tutorials, code snippets, and more! There are 1,627 people online right now. Registration is fast and FREE... Join Now!




Java to .Net Conversion Issue

 

Java to .Net Conversion Issue

vikasck

22 Jun, 2009 - 03:50 AM
Post #1

New D.I.C Head
*

Joined: 22 Jun, 2009
Posts: 1


My Contributions
Hi,

I had an SDK from a third party vendor that consisted of a .JAR file.

I used a Software to convert the .JAR file to a .DLL so that it could be deployed in .Net & I was successful in doing so.

I then Added a reference of the DLL Created in my ASP.Net project.

There is a method called GetServices() which is supposed to return an Array of Services [String].

This method ByDefault references a file which is in the installation folder of the SDK containing the IPAddress and Port Number of the Server with which my Application has to communicate to get some Private Data.

The method & its members are actually encapsulated & is not visible.

In Java, We actually set the CLASSPATH to the folder where the .jar file and the IPAddress File resides.

But in .Net there is no concept of classpath.

Steps tried :

1.) Tried to copy the IPAddress file to the BIN folder of the Project.
2.) Tried to verify whether the DLL was compiled Properly & found that it was working alright.

OutCome:

Getting null instead of a string Array after execution of Getservices() method.

Question : [u]
The problem in 1 line would be to make the Method GetServices() access the file & inturn communicate with the Server to fetch an array of string data.

Please revert back ASAP & do contact me for further explanation.

Thanks



User is offlineProfile CardPM
+Quote Post


woodjom

RE: Java To .Net Conversion Issue

22 Jun, 2009 - 07:44 AM
Post #2

D.I.C Regular
Group Icon

Joined: 8 May, 2008
Posts: 365



Thanked: 15 times
My Contributions
QUOTE(vikasck @ 22 Jun, 2009 - 05:50 AM) *

Hi,

I had an SDK from a third party vendor that consisted of a .JAR file.

I used a Software to convert the .JAR file to a .DLL so that it could be deployed in .Net & I was successful in doing so.

I then Added a reference of the DLL Created in my ASP.Net project.

There is a method called GetServices() which is supposed to return an Array of Services [String].

This method ByDefault references a file which is in the installation folder of the SDK containing the IPAddress and Port Number of the Server with which my Application has to communicate to get some Private Data.

The method & its members are actually encapsulated & is not visible.

In Java, We actually set the CLASSPATH to the folder where the .jar file and the IPAddress File resides.

But in .Net there is no concept of classpath.

Steps tried :

1.) Tried to copy the IPAddress file to the BIN folder of the Project.
2.) Tried to verify whether the DLL was compiled Properly & found that it was working alright.

OutCome:

Getting null instead of a string Array after execution of Getservices() method.

Question : [u]
The problem in 1 line would be to make the Method GetServices() access the file & inturn communicate with the Server to fetch an array of string data.

Please revert back ASAP & do contact me for further explanation.

Thanks


Have you tried creating an instance of the function using <DLLimport(".....")>? This is an old VB trick to getting access to a DLL function without including the whole dll as a reference to the application. Check out the full format for this attribute to see what each of the settings are and see if you can get access to the dll like you want. Also, you might better cracking the JAR open and getting a couple programmers together and making your own DLL from the JAR. I generally dont trust translator/convertors that do something like that. JAR files if done right are security strong and therefore the best someone could do is estimate what the class/methods are doing. Unlike JAVA files, you cant directly look and see what they are doing in a JAR.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 10:48PM

Live ASP.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

ASP.NET Tutorials

Reference Sheets

ASP.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month