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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:06:41+00:00 2026-05-17T16:06:41+00:00

We use Spring-WS as the basis for implementing a web service (with the WSDL

  • 0

We use Spring-WS as the basis for implementing a web service (with the WSDL generated by the framework). As well as a WAR file our build produces a client side JAR (for use by our Java clients and our own end-to-end functional tests) consisting of schema generated DTOs and stubs for the web service methods. These are generated using wsimport (JAX-WS). Problem is this gives rise to a multi-step build process:

  1. Build the server WAR file;
  2. Start Tomcat (to make the WSDL available);
  3. Generate the client side stubs (pointing wsimport at the WSDL url).

Is there some way to generate the WSDL without having to start the web service? Then we could build everything in a single step.

  • 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-05-17T16:06:41+00:00Added an answer on May 17, 2026 at 4:06 pm

    This example code is suitable for the basis of an Ant task:

    import javax.xml.stream.XMLStreamException;
    import javax.xml.transform.TransformerFactory;
    
    import org.springframework.core.io.FileSystemResource;
    import org.springframework.core.io.Resource;
    import org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition;
    import org.springframework.xml.transform.StringResult;
    import org.springframework.xml.transform.StringSource;
    import org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection;
    
    ....
    
    private String generateWsdlFromSpringInfrastructure() throws Exception
    {
        // We only need to specify the top-level XSD
        FileSystemResource messagesXsdResource = new FileSystemResource("C:/MyProject/xsds/my-messages.xsd");
        CommonsXsdSchemaCollection schemaCollection = new CommonsXsdSchemaCollection(new Resource[] {messagesXsdResource});
        // In-line all the included schemas into the including schema
        schemaCollection.setInline(true);
        schemaCollection.afterPropertiesSet();
    
        DefaultWsdl11Definition definition = new DefaultWsdl11Definition();
        definition.setSchemaCollection(schemaCollection);
        definition.setPortTypeName(portTypeName);
        definition.setLocationUri("http://localhost:8080/myProject/services");
        definition.setTargetNamespace("http://www.acme.com/my-project/definitions");
        definition.afterPropertiesSet();
    
        StringResult wsdlResult = new StringResult();
        TransformerFactory.newInstance().newTransformer().transform(definition.getSource(), wsdlResult);
        return wsdlResult.toString();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have started to use spring aop for cross cutting aspects of our application
What is a very good jsp framework to use with Spring MVC. Are the
Our application deals with millions of records and we use spring with jpa. Currently
I am trying to use Spring Security 3.0.5 in my web application. Basically, I
We use Spring + Hibernate for a Webapp. This Webapp will be deployed on
I'm trying to use Spring IoC with an interface like this: public interface ISimpleService<T>
Can you use a Spring-WS WebserviceTemplate for calling a webservice and avoid that it
Is it possible to use a Spring container for DI from inside Eclipse plugins?
I'm working on a demo that makes use of Spring.NET IoC capability in ASP.NET
In my Spring app, I'd like to use FreeMarker to generate the text of

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.