I am a lifelong student of computer science, music, and literature. In pursuit of those interests, I work by day as a programmer Chemical Abstracts Services, moonlight as the creator and curator of Mashed Code Magazine. review books for The Pragmatic Bookshelf and Manning and listen to a fascinating collection of music while performing all of my duties. I have specialized in working with web services and mastering various testing techniques and tools. I am finally done with formal education, having a B.A. in English from The Ohio State University and a M.S. in Computer Science from Franklin University. Nick is a DZone MVB and is not an employee of DZone and has posted 15 posts at DZone. You can read more from them at their website. View Full User Profile

soapUI Tip: Options for Refreshing a WSDL Definition

09.08.2011
| 5050 views |
  • submit to reddit

Here’s a quick tip for soapUI users that I have been stumbling over recently.  soapUI allows you to refresh an already defined service definition from an updated WSDL file.  But, it’s easy to blow away the data that’s in your SOAP test steps if you chose the wrong options.

First, here’s the specific task I’m talking about.  You have an existing soapUI workspace that has interface definitions already imported and you have at least one test suite using that interface.  Now you’ve made a change to the WSDL and you need to refresh your interface definition in soapUI and update the SOAP test steps in your test suite.  Clearly, you want to update the SOAP requests to match the new WSDL without losing the test data that already exists in the test steps.  You reload a WSDL definition by right-clicking on an interface definition in soapUI as shown below.

Here’s a rundown of the effect of some of the “Update Definition” parameter configurations.  I haven’t gone through every permutation of the parameters, just the ones that seem most useful.  I’ve portrayed the configurations in terms of actions you’re likely to want to take after changing your WSDL.

  • You added a new operation to the WSDL and you want to add default requests for it.

  • You made a change to an existing operation in your WSDL and you want to regenerate existing requests using the new schema without creating optional elements.  This configuration will cause you to lose the data in your existing requests.

  • You made a change to an existing operation in your WSDL and you want to regenerate existing requests using the new schema and create optional elements.  This configuration will cause you to lose the data in your existing requests, unless the elements are optional.

  • You made a change to an existing operation in your WSDL and you want to regenerate existing requests using the new schema and create optional elements.  This configuration will keep the existing data in tact.

  • You made a change to an existing operation in your WSDL and you want to regenerate existing requests and test steps using the new schema without creating optional elements.  This configuration will keep the existing data in tact but will remove optional elements from the existing requests.

  • You made a change to an existing operation in your WSDL and you want to regenerate existing requests and test steps using the new schema and maintain optional elements.  This configuration will keep the existing data and optional elements in tact.

  • The last configuration is the safest bet for most refreshes.  It combines all of the above. That means that it picks up all WSDL changes and incorporates them into both default requests and your SOAP test steps.  None of your existing data will be overwritten.  It also opens up a window that lists exactly which items have been modified.

I have not mentioned the “Keep SOAP Headers” and “Create Backups” parameters because I have not used them yet.

I suggest playing around with the “Update Definition” feature a little before using it.  soapUI is a powerful tool, so it assumes you know what you want.  It accomplishes that by exposing panels with lots of parameters on them, like the “Update Definiton” panel.  If you get yourself into a bind, remember that you can just reload the project you’re working on by right-clicking on the project name and choosing “Reload Project”.  This option will reload the project into the workspace without saving the changes you just made.

 

From http://thewonggei.wordpress.com/2010/12/29/soapui-tip-options-for-refreshing-a-wsdl-definition/

Published at DZone with permission of Nick Watts, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)