soap - Wrapper for Bloomberg Data License Web Services -
i'm looking in bloomberg data license web services. note, different bloomberg api ( session/service/request, b-pipe, etc ). soap-based solution retrieve reference data bloomberg dbs. created test application evaluate solution:
var client = new persecuritywsclient("persecuritywsport"); client.clientcredentials.clientcertificate.certificate = new x509certificate2("{path-to-certificate}", "{password}"); client.clientcredentials.username.username = ""; client.clientcredentials.username.password = ""; client.clientcredentials.windows.clientcredential.domain = ""; var companyfields = new string[] { "id_bb_company", "id_bb_ultimate_parent_co_name" , /* ... other fields i'm interested in */ }; var getcompanyrequest = new submitgetcompanyrequest { headers = new getcompanyheaders { creditrisk = true }, instruments = new instruments { instrument = new instrument[] { new instrument { id = "aapl us", yellowkey = marketsector.equity, yellowkeyspecified = true }, new instrument { id = "prvt us", yellowkey = marketsector.equity, yellowkeyspecified = true } } }, fields = companyfields }; var response = client.submitgetcompanyrequest(getcompanyrequest); if(response.statuscode.code != success) { system.console.error.writeline("response status " + response.statuscode); return; } var retrieve = new retrievegetcompanyrequest { responseid = response.responseid }; retrievegetcompanyresponse getcompanyresponse = null; { system.console.write("*"); thread.sleep(1000); getcompanyresponse = client.retrievegetcompanyresponse(retrieve); } while (getcompanyresponse.statuscode.code == data_not_available); if (getcompanyresponse.statuscode.code != success) { system.console.error.writeline("response status " + response.statuscode); return; } system.console.writeline(); foreach (var instrumentdata in getcompanyresponse.instrumentdatas) { console.writeline("data for: " + instrumentdata.instrument.id + " [" + instrumentdata.instrument.yellowkey + "]"); int fieldindex = 0; foreach (var dataentry in instrumentdata.data) { if (dataentry.isarray) { console.writeline(companyfields[fieldindex] + ":"); foreach(var arrayentry in dataentry.bulkarray) { foreach(var arrayentrydata in arrayentry.data) { console.writeline("\t" + arrayentrydata.value); } } } else { console.writeline(companyfields[fieldindex] + ": " + dataentry.value); } ++fieldindex; } system.console.writeline("-- -- -- -- -- -- -- -- -- -- -- -- --"); }
the code looks bloated (well, indeed, soap-based in 2015). hence question -- assume there should wrappers, helpers, else facilitate reference data retrieval, but on there 1 question regarding bb dlws. here using dlws? there known libraries around bb dlws? supposed slow?
thanks.
i'm getting myself. there 2 options requesting data: sftp , web services. understanding, sftp option requires bloomberg application ("request builder") in order retrieve data.
the second option (web services) doesn't seem well-documented, @ least working r (like myself). so, doubt library exists web services @ point. bloomberg provides authentication certificate in order gain access network, web services host , port information. now, in terms of using information connect , download data, still beyond me.
if or else has been able connect , extract data using bloomberg web services , r, please post detailed code blog!
Comments
Post a Comment