java - Wrapping primitives for CXF -


i need send list of primitives on web service, example parameters run stored procedure. in java have list. doesn't work cxf. ended doing list simpledataitem attached code. idea, or there better aproaches?

i'm executing function this:

resultset executestoredproc(string procname, object... args) throws sqlexception; 

right simpledataitem looks 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 ba      */     public byte[] getba() {         return ba;     }      /**      * @param ba ba 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 idea? there better aproaches?

this isn't cxf problem, it's web service problem. trying send polymorphic data structure. need schema uses xml schema union of possible types.

see jaxb - unmarshalling polymorphic objects.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -