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

  • Home
  • SEARCH
  • 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 7642159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:07:07+00:00 2026-05-31T09:07:07+00:00

I sometimes need to send a list of primitives over a web service, for

  • 0

I sometimes need to send a list of primitives over a web service, for example as the parameters to run a stored procedure. In Java basically I have List. This doesn’t work with CXF. I ended up doing List where SimpleDataItem is the attached code. Is this a good idea, or are there better aproaches?

I’m basically executing a function that I would like to look like this:

ResultSet executeStoredProc(String procName, Object... args) throws SQLException;

Right now SimpleDataItem looks like this:

public class SimpleDataItem {
    private String s;
    private Long l;
    private Integer i;
    private BigDecimal d;
    private Boolean b;
    private Long t;
    private byte[] ba;



    public SimpleDataItem() {

    }

    public SimpleDataItem(Object o) {
        doSetObject(o);
    }

    public void doSetObject(Object o) {
        if (o==null) {
            return;
        }
        if (o instanceof String ) {
            s=(String)o;
            return;
        }
        if (o instanceof Long ) {
            l=(Long)o;
            return;
        }
        if (o instanceof Integer ) {
            i=(Integer)o;
            return;
        }
        if (o instanceof BigDecimal) {
            d=(BigDecimal)o;
            return ;
        }

        if (o instanceof Boolean) {
            b=(Boolean)o;
            return ;
        }
        if (o instanceof Timestamp) {
            t=((Timestamp)o).getTime();
            return;
        }
        if (o instanceof byte[]) {
            ba=(byte[])o;
        }

    }

    public Object doGetObject() {
        if (s!=null) {
            return s;
        }
        if (l!=null) {
            return l;
        }
        if (i!=null) {
            return i;
        }
        if (d!=null) {
            return d;
        }
        if (b!=null) {
            return b;
        }
        if (t!=null) {
            return new Timestamp(t);
        }
        if (ba!=null) {
            return ba;
        }
        return null;
    }

    /**
     * @return the ba
     */
    public byte[] getBa() {
        return ba;
    }

    /**
     * @param ba the ba to set
     */
    public void setBa(byte[] ba) {
        this.ba = ba;
    }

    public String getS() {
        return s;
    }

    public void setS(String s) {
        this.s = s;
    }

    public Long getL() {
        return l;
    }

    public void setL(Long l) {
        this.l = l;
    }

    public Integer getI() {
        return i;
    }

    public void setI(Integer i) {
        this.i = i;
    }

    public BigDecimal getD() {
        return d;
    }

    public void setD(BigDecimal d) {
        this.d = d;
    }

    public Boolean getB() {
        return b;
    }

    public void setB(Boolean b) {
        this.b = b;
    }

    public Long getT() {
        return t;
    }

    public void setT(Long t) {
        this.t = t;
    }

    public String toString() {
        Object o=doGetObject();
        if (o!=null) {
            return o.toString();
        }
        return null;
    }   
}

Is this a good idea? Are there better aproaches?

  • 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-31T09:07:09+00:00Added an answer on May 31, 2026 at 9:07 am

    This isn’t a CXF problem, it’s a web service problem. You are trying to send a polymorphic data structure. So you need a schema that uses an XML Schema union of the possible types.

    See JAXB – Unmarshalling polymorphic objects.

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

Sidebar

Related Questions

I have a URL, lets say http://www.example.com . Sometimes, I need to send HTTP
I sometimes need to run gacutil.exe or installutil.exe, etc. from the command line. Is
I need to send some left-over data to server when my app starts, so
I need to send e mail from a asp.net web site. I use this
Sometimes I need to send Esc to the insert buffer. So I could generate
I need to send a few large files to a computer over the internet.
I'm need to send params to the function array_intersect_key() but sometimes i'm need to
I sometimes need to look for information for a special portion of code. When
I sometimes need to debug JS in other browsers, and it would be really
In my app I sometimes need to rebuild and repopulate database file. SQLite databse

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.