Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8866953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:54:28+00:00 2026-06-14T16:54:28+00:00

I have a WSDL which has multiple operations. For each op i want a

  • 0

I have a WSDL which has multiple operations. For each op i want a template .xml with its response and request.

I know how to do this manually in soapUI but I would like to generate them using a groovy script.
I googled a lot already, but seems I’m the only one who is looking for this.

My service has 16 Operations, so to do this manual would be too much time. Since the service gets updates every 2 months, an automation using a test step would be perfect.

I managed to do it for the requests already:

right-click on ´services´ in left tree, ´Generate Test Suite´, ´Single Test Case with one Request for each Operation´

then I loop through those Test Step Requests and store them on my disk.

    import com.eviware.soapui.impl.wsdl.teststeps.*

    for( testCase in testRunner.testCase.testSuite.getTestCaseList() ) 
    {
        for( testStep in testCase.getTestStepList() ) 
        {
            if( testStep instanceof WsdlTestRequestStep ) 
            {
                log.info "operation name: " +testStep.getName()

                // create file name
                Date startTime = new Date();
                def cur_Time = startTime.getMonth() + "_" + startTime.getDate();
                cur_Time = cur_Time + "_" + startTime.getHours() + startTime.getMinutes() +startTime.getSeconds()
                def fileName = testStep.getName() + "_" + cur_Time

                def inputFileRequest = new File("T:\\"+ "Request_" + fileName+".txt")
                def inputFileResponse = new File("T:\\"+ "Response_" + fileName+".txt")
                // write request to file
                inputFileRequest.write(testStep.getProperty("request").value)
            }
        }
    }

But I havent figured out a way to do this also for the resposes.
If i use getProperty(“reponse”) it’s null of course.

Any hint? 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:54:29+00:00Added an answer on June 14, 2026 at 4:54 pm

    and the winner is, I figured it out myself:

    map = context.testCase.testSuite.project.interfaces["services"].operations
    
    for (entry in map)
    {
        opName = entry.getKey()
        inputFileRequest = new File("T:\\" + opName + "Request.xml")
        inputFileResponse = new File("T:\\" + opName + "Response.xml")
    
        inputFileRequest.write(entry.getValue().createRequest(true))
        inputFileResponse.write(entry.getValue().createResponse(true))
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WSDL script which has the following format <definitions name=ProcessData targetNamespace=urn:ProcessData> <message
I have a server application in Java which has two simple operations, addTwoInts and
I have a webservice which has been coded with c#. I want to use
I have a WSDL URL which has security constriants. I need to provide username
I have a WSDL which contains 3 schemas inside it's types element. The schemas
I have a WSDL 1.1 file which describes my Web Service. Now I need
I have two project, one which generates some artifacts from a WSDL file using
I have just a .net wsdl file and I want to connect to it
i have the WCF web service within my solution. service has interface which implemeted
I have been given a wsdl file by a company which will integrate with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.