title: Wrapper for Bloomberg Data License Web Services
body: <p>I'm looking now in <a href="http://www.bloomberg.com/enterprise/content/uploads/sites/2/2013/09/Data_License_Brochure.pdf" rel="nofollow noreferrer">Bloomberg Data License Web Services</a>. Note, that this is different from Bloomberg API ( Session/Service/Request, b-pipe, etc ). It is SOAP-based solution to retrieve reference data from Bloomberg DBs. I created a test application just to quickly evaluate this solution:</p>
  
  <pre><code>    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" , /* ... all 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 is " + response.statusCode);
      return;
  }
  var retrieve = new RetrieveGetCompanyRequest { responseId = response.responseId };
  RetrieveGetCompanyResponse getCompanyResponse = null;
  do {
      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 is " + 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("-- -- -- -- -- -- -- -- -- -- -- -- --");
  }
  </code></pre>
  
  <p>The code looks somewhat bloated (well, it is indeed, SOAP-based in 2015). Hence is my question -- I assume there should be some wrappers, helpers, anything else to facilitate reference data retrieval, <a href="https://stackoverflow.com/questions/31011747/bloomberg-web-service-call-for-single-field-and-single-instrument-taking-more-th">but even on SO there is only one question regarding BB DLWS</a>. Is here anyone using DLWS? Are there any known libraries around BB DLWS? Is it <em>supposed</em> to be that slow?</p>
  
  <p>Thanks.</p>