This project has moved and is read-only. For the latest updates, please go here.

Using Bloomberg API Emuator dll in java

Apr 3, 2013 at 2:22 PM
I am accessing your Emulator dll in my java code, but having some dependency. for accessing the dll in java "[assembly: ComVisible(true)]" option is to be enabled in while creating dll and I also need .tlb file to create a bridge between your dll and my java code.
Any suggestion on this.
Coordinator
Apr 3, 2013 at 4:42 PM
sagarzope,

Please check out the latest version of my source code (commit 4e901845229e). I checked the "Make Com Visible" option, and I had Visual Studio generate the .TLB file. You can find the latest .TLB file in the Source Code tab under the BEmu/bin/Release folder.

I will soon release a new version of the Bloomberg API Emulator (v 1.0.3) that will include this ComVisible option and the .TLB file. I am working on including IntradayBarRequests and that will be a part of the latest release. When I do that, you can simply download the latest files in the Downloads tab to get the ComVisible DLL and the TLB file. Until that time, please look at the files in the Source Code tab. (I would like to release version 1.0.3 this week)

Please let me know if you can get this to work. I am considering a full Java port so that a user can use the Java version of the Bloomberg API (Java link here). I cannot guarantee that using the .TLB file with your Java code will work the same as using the actual Bloomberg API written for Java with your Java code.

Thank you for your interest in my project. I look forward to your response.
Coordinator
Apr 4, 2013 at 9:37 PM
sagarzope,

There is one other consideration concerning the ComVisible attribute. I am not sure if the actual Bloomberg API is marked as ComVisible. I am also unsure if any *.TLB file exists for the actual Bloomberg API. It might be the case that you write Java code that makes calls to the Bloomberg Emulator and it runs fine. But then when you try to do this with the actual Bloomberg API, it doesn't work. I don't know how to test this.
Apr 5, 2013 at 6:16 AM
Edited Apr 5, 2013 at 12:58 PM
Robinson664,

Yes, it might happen, but I first want to test the bloomberg service without license and there is no better way than this , it can happen that I will use bloomberg java api and write my own code to access it.

Can you provide a properly created documentation how you created this emulator, and license is required for this or not?
Coordinator
Apr 5, 2013 at 2:18 PM
sagarzope,

It took a while, but I found out that the Bloomberglp.Blpapi.dll file is not ComVisible. I used this code:
using System.Reflection;
using System.Runtime.InteropServices;
private static bool CheckComVisible()
{
    var assembly = Assembly.LoadFile(@"C:\PathToFile\Bloomberglp.Blpapi.dll");
    var attributes = assembly.GetCustomAttributes(typeof(ComVisibleAttribute), false);

    if (attributes.Length > 0)
        return ((ComVisibleAttribute)attributes[0]).Value;

    return false;
}
If you think that keeping BEmu ComVisible will help you with your development, then great. I want to be sure not to mislead people about the Com Visibility of the actual Bloomberg API.

Concerning documentation, all of the documentation I have for the Bloomberg Emulator, I put in the Documentation tab on this CodePlex site. Given that I wrote the Bloomberg API Emulator to act just like the actual Bloomberg API, the documentation available from Bloomberg should be sufficient for you.

If you need documentation for contributing to my project on the other hand, please let me know.
Coordinator
May 5, 2013 at 5:58 PM
I've begun porting my code to Java. Right now my Java code supports Intraday Tick Requests and Intraday Bar Requests. I'm learning Java as I go, but code that you'd write works for both my emulator and the actual API. I hope that you will find this useful.