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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:07:13+00:00 2026-05-22T21:07:13+00:00

I generated my client side stubs for a NetBeans webservice. The webservice implementation uses

  • 0

I generated my client side stubs for a NetBeans webservice.

The webservice implementation uses a local POJO from my project. The generated stubs have created a revision of this POJO for use. When I’m using the service, I want to use the original POJO, not the generated type..? Type casting doesn’t work.

i.e. (note the packages)

package adiib.ws.harmoniser;

@WebMethod(operationName = "getStartupLogMessages")
public ArrayList<LogMessage> getStartupLogMessages() {
    return startupLogMessages;
}

The POJO LogMessage reads:

package adiib.shared;

public class LogMessage implements Serializable 
{    
    private static final long serialVersionUID = 8379681391654158512L;

    private String exceptionMessage;
    private String customMessage;
    private String stackTrace;
    private LogMessageEnum classification;
    private String effectiveTime;
    private String exceptionClassName;
    private String throwerClassName;

    public LogMessage(){}

    public LogMessage(String exceptionMessage, String customMessage,
        String stackTrace, LogMessageEnum classification, String effectiveTime,
        String exceptionClassName, String throwerClassName)
    {
        this.exceptionMessage = exceptionMessage;
        this.customMessage = customMessage;
        this.stackTrace = stackTrace;
        this.classification = classification;
        this.effectiveTime = effectiveTime;
        this.exceptionClassName = exceptionClassName;
        this.throwerClassName = throwerClassName;
    }

    public String getCustomMessage() {
        return customMessage;
    }

    public void setCustomMessage(String customMessage) {
        this.customMessage = customMessage;
    }

    public String getExceptionMessage() {
        return exceptionMessage;
    }

    public void setExceptionMessage(String exceptionMessage) {
        this.exceptionMessage = exceptionMessage;
    }

    public LogMessageEnum getClassification() {
        return classification;
    }

    public void setClassification(LogMessageEnum classification) {
        this.classification = classification;
    }

    public String getEffectiveTime() {
        return effectiveTime;
    }

    public void setEffectiveTime(String effectiveTime) {
        this.effectiveTime = effectiveTime;
    }

    public String getStackTrace() {
        return stackTrace;
    }

    public void setStackTrace(String stackTrace) {
        this.stackTrace = stackTrace;
    }

    public String getExceptionClassName() {
        return exceptionClassName;
    }

    public void setExceptionClassName(String exceptionClassName) {
        this.exceptionClassName = exceptionClassName;
    }

    public String getThrowerClassName() {
        return throwerClassName;
    }

    public void setThrowerClassName(String throwerClassName) {
        this.throwerClassName = throwerClassName;
    }    
}

Now, on the client side when I’m trying to use the webservice method like so:

package adiib.server;

private void getStartupLogMessages() {

private static List<LogMessage> logMessages = new ArrayList<LogMessage>();

    dsto.adiib.ws.client.harmoniser.AdiibHarmoniser_Service service = new dsto.adiib.ws.client.harmoniser.AdiibHarmoniser_Service();
    dsto.adiib.ws.client.harmoniser.AdiibHarmoniser port = service.getAdiibHarmoniserPort();

    List<dsto.adiib.ws.client.harmoniser.LogMessage> startupLogMessages = port.getStartupLogMessages();
    for (adiib.ws.client.harmoniser.LogMessage logMessage : startupLogMessages) {
        /* 
         * this fails becuase it's looking for adiib.ws.client.harmoniser.LogMessage
         * not adiib.shared.LogMessage; adiib.ws.client.harmoniser.LogMessage is the
         * generated type..
         */
        logMessages.add((LogMessage) logMessage);
    }
}

Any ideas? All I can think is creating a conversion method.. that seems wrong.

WulfgarPro

  • 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-22T21:07:14+00:00Added an answer on May 22, 2026 at 9:07 pm

    The classes generated by the tool are not the same as the original ones you have. So you have to use the tool generated ones in your client side to communicate with the web service. You cannot replace it with the ones you wrote for your server side.

    For example, consider JAX-WS built client side DTOs. If you open up the source code, you will see that the auto-generated ones (using wsimport) contains annotations which may not be present (unless you manually wrote) in your server side classes. Therefore, as of my understanding, you have to go with the tool generated ones.

    You might have to write methods to transform your DTOs to the tool generated one before web service is invoked. If your generated classes have the same set of properties (type and naming has not been altered by the tool when generating client DTOs), then probably you could use something like Apache Commons BeanUtils (see http://commons.apache.org/beanutils/) to aid in transformation. You can simply call BeanUtils.copyProperties() and pass in your source DTO (your own type) and the target DTO (WS generated) and get it transformed.

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

Sidebar

Related Questions

I have gwt web project, which must use application.properties (on client side) loaded as
I need to generate many internal client-side (within the company only) graphs from streams
I am trying to set the request (and connection) timeout for a jax-ws-webservice-client generated
I am trying to call a webservice. The client was generated with weblogic's ant
I have created a axis2 webservice including a method with multiple parameters: class Service
I am trying to display image, which is dynamically generated on client side with
I'd like to use Jade templates client-side. Preferably generated using the Rails 3.1 asset
I have always thought of JavaScript as a client-side scripting tool for augmenting the
I have two client-side RIA services projects, each mapped to server-side RIA assembly for
I'm trying to integrate unobtrusive client-side validation in my ASP.NET MVC 3 project, as

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.