Skip to Content

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

image

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) .
    image;
    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

To report this post you need to login first.

14 Comments

You must be Logged on to comment or reply to a post.

    1. Bertram Ganz Post author
      Hallo Robin,

      Principally speaking “yes”. But: there is a special difference which has to be considered. The Java-Bean model is based on a set of model-entities and a set of related model classes which are located in other packages (Java Bean model class packages) then the model-entities package. Model-entities are the metamodel-representations of the imported Java Bean model class.

      Consequently it is not sufficient to make all model-entities within the model package namespace writable (readOnly=false). Additionally all related JavaBean model classes in a separate namespace must explicitly set writable.

      Nevertheless there are no proxy classes which have to be deleted manually. Based on the above description the delete-operation will eliminate all those files which belong to the model.

      Regards, Bertram

      (0) 
  1. Cindy Herrman
    To get this to work with SP11, we also had to delete the files in the src/packages/wsdls directory.  Otherwise the re-import would create the proxy classes, etc. but the model would not be created (was not added into the Models section of the Web Dynrpo Explorer) and the errors would not disappear when the project was reloaded and rebuilt.
    (0) 
  2. Bhavik Devisha
    I have tried this thing in WAS SP12. But, I can’t able to create model once again.

    It is not giving error while creating. But, I am nt able to see any model under models node in webdynpro explorer.

    I have also tried with deleting wsdls folder. But it is not getting reflected.

    Is there any other changes need to make for re-importing model?

    (0) 
    1. Bertram Ganz Post author
      Hallo Stanislav,

      as long as the WSDL URL keeps static there is a simple solution:

      The WSDL URL can be defined within the Logical Port Editor:
      -> Doubleclick Logical Port
      -> Change URL
      -> Save
      -> Redeploy your application

      Regards, Bertram

      (0) 
  3. Kiran Kumar
    Hello Bertram,

    Thanks a lot for the article. I am using NWDI and want to know how to have my webservice model point to a different web service implementation when it moves to QA or Production?

    Is destination service an answer? Or is there another way? I am using sp13. I heard some new developments in this area with sp17.. ?

    Thanks,
    Kiran

    (0) 
    1. John Bilay
      Hello Kiran

      Have you find out out to make webservice model point to a different web service implementation when it moves to QA or Production?

      I am having to deal with it as well

      Regards

      (0) 
  4. Jon Nedelmann
    Hello Bertram,

    after reimporting an adaptive web service model according to your guidelines several times successfully, I ran into a problem: after the last step (reload & rebuild of  the project) in the component controller the import statements of the wdp  directory cannot be resolved anymore and hence the object wdContext itself cannot be resolved anymore.

    Do you have any idea what wen`t wrong? 

    (0) 
    1. Tim Rudolph
      Hi Jon,

      try to find the source problem. I am sure there is one. All the other problems you describe will vanish once you solved it and rebuilt the project.

      If you don’t find the source problem in your implementation, check, whether all the context attributes you reference in your views are still available. Also check the context mapping between controller and views.

      Tim

      PS Unfortunately I don’t have the time to give you exact explanations. However, I was facing this problem several times and believe me, your component is not lost 😉

      (0) 
  5. Anilkumar Vippagunta
    Hi,

    WD app failing as it could not pickup the Web service model changes at runtime.We are on CE 7.2 SP3.

    Issue was solved by restarting the server on Dev box.

    We are having same issue in Q box but we don’ want to bounce Q box.Is there any way we can clear web service cache ?

    Thanks, Anil

    (0) 

Leave a Reply