VMware {code} Community
SreeSindhuSruth
Enthusiast
Enthusiast

code works fine only after refresh in flex client

Hi,

We have some back end code changes done and we are observing a behaviour where the code is working as expected once we refresh the vsphere client.

We are not seeing any errors as well.  Please let us know what could cause this.

pastedImage_0.png

Tags (2)
0 Kudos
4 Replies
SreeSindhuSruth
Enthusiast
Enthusiast

The refresh will get the updated data for all sessions. So is this something to do with web client session.

0 Kudos
_vladi_
VMware Employee
VMware Employee

Hi,

You plugin frontend code should take care to refresh the view when data has changed. Freshing the Client works because then the plugin iframe is reloaded and you are probably getting the latest data from your backend.

You need to reload the data of your plugin view on the events applicable to your use case: e.g. user selection inside the view or regularly polling for data.

Cheers,

Vladi

0 Kudos
SreeSindhuSruth
Enthusiast
Enthusiast

@__vladi__,

We have observed this could be due to mutiple sessions in the backend logic.

The following is the code snippet  related to session, we are looking on how to make use of existing session , with out having a new session.

Can you please provide inputs to work on handling things wrt session.( if check for session and extend the session till it executes certain piece of code).

vimService = new VimService();

  vimPort = vimService.getVimPort();

  Map<String, Object> ctxt = ((BindingProvider) vimPort)

  .getRequestContext();

  ctxt.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,"https://"+credentials.getHostname()+"/sdk/vimService");

  ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);

  serviceContent = vimPort.retrieveServiceContent(SVC_INST_REF);

  vimPort.login(serviceContent.getSessionManager(), credentials.getUsername(),

  credentials.getPassword(), null);

0 Kudos
_vladi_
VMware Employee
VMware Employee

Hi,

Please have a look at the latest HTML Sample: the VimObjectService demonstrates how to use the vimPort.

Cheers,

Vladi

0 Kudos