I try to get the service metadata of a sapui5 v2 odata model.
Code:

```
var oModel = new sap.ui.model.odata.v2.ODataModel(someServiceURL);
var oMetadata = oModel.getServiceMetadata();

```

This should work according to this page:
<https://openui5beta.hana.ondemand.com/docs/guide/6c47b2b39db9404582994070ec3d57a2.html>

Anyhow I got "`undefined`" for `oMetadata`.
If I change code to:

```
var oModel = new sap.ui.model.odata.v2.ODataModel({
        loadMetadataAsync : false,
        serviceUrl : someServiceURL
});

```

Still `oMetadata === undefined`

According to SDK documentation metadata should be loaded in sync:

> 
> Return the metadata object. Please note that when using the model with
>  bLoadMetadataAsync = true then this function might return undefined
>  because the metadata has not been loaded yet. In this case attach to
>  the metadataLoaded event to get notified when the metadata is
>  available and then call this function.
> 
> 
> 

What is wrong with my code?

I am using (1.28.11):

```
<script src="https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js"    ...

```

I started debugging the UI5 code and detected following line:
this.bLoadMetadataAsync = true;

I started debugging of SAPUI5 code and detected following line (seems to be called each time):

```
this.bLoadMetadataAsync = true;

```

Is it a bug? Or is something wrong with my code?