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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:33:22+00:00 2026-06-18T08:33:22+00:00

I am using WSDL-first. I have WSDL and generate Java code using Maven plugin

  • 0

I am using WSDL-first. I have WSDL and generate Java code using Maven plugin ‘cxf-codegen-plugin’. Using Code-first one can write DTO for example:

public class ServiceSearchCriteria {
    private String phoneNumber;
    private String businessId;

    public boolean validateSearchCriteria() {
        if ((phoneNumber != null) || (businessId != null)) {
            return true;
        }
        return false;
    }
    //... setters/getters etc.
}

So using Code-First (Java-First) it is easy to write DTO with validation method. Client can check if search criteria are good fulfilled. This class would be returned by WebService class annotiated with @WebService. And this will work.

But how to write such DTO (with some method) using WSDL-First approach?

I very like WSDL-First approach (it has many advantages but this is not place to write about them) but I would like to add method… just not to write “anemic domain model” and allowing client to check search criteria fulfilled before sending to server.

  • 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-18T08:33:23+00:00Added an answer on June 18, 2026 at 8:33 am

    You seem to be mixing various concepts. It’s cool you don’t want to have an anemic domain model but that has nothing to do with your DTOs which in turn has nothing to do with how the classes from WSDL look like.

    A DTO has state but no behavior. Hence, they have only getters/setters but contain no logic (e.g. validation).

    The objects in the domain model have state and behavior (unless they’re anemic of course).

    So, if there’s a need for DTOs, which depends on your architecture, you’d be converting business objects from the domain model to DTOs and vice versa. If you consider the classes generated from your WSDL DTOs which would be ok then you need to convert those to your business objects. “Converting” in this respect means transferring their state.

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

Sidebar

Related Questions

I generate some code using CXF from a WSDL-file. When compiling the code with
What is the exact way of generating a Java code using WSDL in a
I have two project, one which generates some artifacts from a WSDL file using
I have hard times using maven to generate my web service client. So please
I'm developing a webservice using a WSDL (contract-first) that defines one of it's fields
I am using suds client for WSDL in our project. i have this code
I'm generating Java from WSDL using wsimport (JAX-WS 2.1.3) and need to make it
I'm trying to generate some stubs for a WSDL (using xmlbeans) and keep running
I am using wsimport to generate my JAX-WS client from a WSDL file (which
I am using ASIHTTPRequest in IOS. I have aloso a wsdl/soap web services. when

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.