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 8408437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:37:53+00:00 2026-06-09T23:37:53+00:00

I am using groovy-wslite for making SOAP calls to a WSDL and need one

  • 0

I am using groovy-wslite for making SOAP calls to a WSDL and need one of the xml nodes that it generates to have an attribute. Here is an example of what I need:

<soap-env:Envelope xmlns:soap-env='http://schemas.xmlsoap.org/soap/envelope/'
  <soap-env:Header />
  <soap-env:Body>
  <getSomething id = "1">
  </getSomething>
  </soap-env:Body>
</soap-env:Envelope>

In this example, I need the getSomething call to have the id attribute.

  • 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-09T23:37:55+00:00Added an answer on June 9, 2026 at 11:37 pm

    Besides a closure that will build out child elements, you can also pass a map whose key/values will become attributes. The following would generate a SOAP request matching what you have.

    @Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='0.7.1')
    import wslite.soap.*
    
    def client = new SOAPClient('http://...')
    def response = client.send {
        header
        body {
            getSomething(id:'1') {
                //more elements here if needed
            }
        }
    }
    

    Groovy’s MarkupBuilder is used under the hood, so any examples you find for MarkupBuilder should also apply when generating SOAP requests with wslite.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to print XML that I manipulated using groovy and maintain the attribute
I need to get the value 3 from the below xml file using groovy
I'm making Liquibase migration using groovy script. I have a code like def migrate()
I have a Grails project that I created using Groovy/Grails Tool Suite version 3.0.0M3
I have thousands of HTML files to process using Groovy/Java and I need to
I am using Groovy SQL for my DB access. Very nice, but I have
In my jmeter test, I have a BSF PreProcessor step (using groovy) running before
I am using groovy/grails, and I have a ResultList in my service which I
I'm using groovy.xml.MarkupBuilder to create XML response but it creates prettyprinted result which is
I have a java project (not using groovy) but I'd like to interactively play

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.