Additional Blogs by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
BeGanz
Product and Topic Expert
Product and Topic Expert

When developing large Web Dynpro applications it is in most cases inevitable to update an existing Web Service model because the underlying Web Service definition has been changed. Web Dynpro application developers try to avoid such a situation because they do not want to re-declare all existing context-to-model-bindings.

Allthough The NetWeaver Developer Studio version NW04 or NW04s does not support the reimport of existing Web Service models there is a workaround for avoiding a time-consuming re-declaration of the existing context-to-model-bindings in all your context model nodes. The solution is based on following some rules when deleting and re-importing a given Web Service model.

Preserving existing model bindings in controller contexts

In order to preserve existing model bindings in controller contexts, several issues have to be considered. All files (metamodel entities as well as Web Service proxies) have to be deleted in order to import the Web Service model with the same name in the same package later on, which in turn is a first precondition for preserving the model bindings in the context. A second precondition is that all non-model-specific files have to be readonly. Otherwise existing model bindings in contexts might get deleted while the corresponding model itself will be deleted. If the Web Service has been changed in an incompatible way, like deletion or renaming of fields in complex types, the model-bindings have to be adapted accordingly.

The recommended procedure for easily reimporting an existing Web Service model differs for local Web Dynpro projects or local DCs and for NWDI-based Web Dynpro DCs.

Web Dynpro Projects and local Web Dynpro DCs

  1. Ensure that certain non-model-specific files contained in the source folder of your project are readonly.
    For deleting a model usage within your project you must first ensure, that all files under the src/packages folder are readonly except those files which are contained in the specific Web Service model namespace and the specific ProjectProperties.properties file. Make sure that all files within the Web Service model folder  and the src/packages/ProjectProperties.properties are still writable (readOnly = false) .
    ;
    If you're using a source control system files will always be set to readonly in case all changelists have been submitted. If you aren't using any source control system you can use the windows explorer in order to set all non-model-specific files to readonly that are contained in the src/packages folder of your project within a first step. In a second step the model-sub-folder plus the file src/packages/ProjectProperties.properites must be set to readonly = false in the same way. This ensures that existing model bindings won't get lost.
  2. Delete the entire Web Service Model.
    Before deleting the corresponding model you might want to note down the model name and the model package as you have to do the subsequent import in exactly the same package and with the same name. Select the corresponding model instance in the Web Dynpro Explorer and choose 'Delete' from the context menue.
  3. Ensure that the entire model folder including its subfolders is empty. Switch to the 'Navigator' view for this purpose.
    If one of the subfolders of the corresponding model still contains some files, e.g. the subfolder 'proxies' of the corresponding model, you should delete the entire folder manually.
  4. Create a new Web Service model based on the updated Web Service definition.
    Please double check that you've entered the same model name and the same model package in the corresponding import wizard page.
  5. Make all files writable again.
    After having completed these steps you can set the readOnly-property for the complete src/packages folder to false again.
  6. Perform a 'Reload' of the entire Web Dynpro project.
    Select the corresponding action in the context menue that is displayed on project node level. If the Web Service has been updated in a compatible way, all model bindings in the context will be resolved again - the task list should not contain any errors.

NWDI-based Web Dynpro DCs

  1. Ensure that all open activities are submitted.
    This guarantees that all entities of the project are in a readonly state.
  2. Delete the entire Web Service Model.
    Before deleting the corresponding model you might want to note down the model name and the model package as you have to do the subsequent import in exactly the same package and with the same name. Select the corresponding model instance in the Web Dynpro Explorer and choose 'Delete' from the context menue. A popup will display a list of all model entities. The newly created activity should also be used for the model creation later on.
  3. Ensure that the entire model folder including its subfolders is empty. Switch to the 'Navigator' view for this purpose.
    If one of the subfolders of the corresponding model still contains some files, e.g. in the subfolder 'proxies', you should delete them manually. For this you have to switch to the 'Development Configuration Perspective'. You can either select the files itself and choose 'DTR - Delete' or you can delete the entire subfolder. The second approach will delete the files within a separate activity.
  4. Create a new Web Service model based on the updated Web Service definition
    Please double check that you've entered the same model name and the same model package in the corresponding import wizard page.
  5. Perform a 'Reload' of the entire Web Dynpro DC after the model has been successfully imported.
    Select the corresponding action in the context menue that is displayed on project node level. If the Web Service has been updated in a compatible way, all model bindings in the context will be resolved again - the task list should not contain any errors.

Lothar Bender, Bertram Ganz, SAP AG

14 Comments