I would think that reflection should be powerful enough to decide what to
do,
as long as no custom types are used, but it seems that I have to resign
myself
to the fact that Object is problematic.

Thank you Mark and Aaron for sharing your insight.



On Tue, Apr 1, 2014 at 12:02 PM, Mark Streit <[email protected]> wrote:

> The issue of Map vs HashMap seems plausible but the fact that the signature
> has java.lang.Object as a parameter still leaves unanswered the question -
> "what would JAXB use to deserialize something with no compatible XSD type"
> ?
>
>
> http://stackoverflow.com/questions/3191201/can-i-have-object-type-as-a-parameter-of-webmethod
>
>
>
> On Tue, Apr 1, 2014 at 3:44 PM, Al Eridani <[email protected]> wrote:
>
> > > Without a concrete class identified, how
> > > would the program decide which implementation of a list or map should
> be
> > > used?
> >
> > I don't think that is the problem. If it can do it for Map<String,
> String>,
> > why
> > can't it do it for Map<String, Object>? Why does one need to change from
> > Map<String, String> to HashMap<String, Object>?
> >
> >
> > On Tue, Apr 1, 2014 at 6:42 AM, Aaron Titus <[email protected]> wrote:
> >
> > > List and Map are interfaces.  Without a concrete class identified, how
> > > would the program decide which implementation of a list or map should
> be
> > > used?   I know this can be handled with custom deserialization/
> > > serialization but I thought I saw somewhere that there would be a way
> to
> > do
> > > it by declaring it via binding syntax?  I can't seem to put my finger
> on
> > it
> > > at the moment ...
> > >
> > >
> > > On Tue, Apr 1, 2014 at 12:29 PM, Al Eridani <[email protected]>
> > wrote:
> > >
> > > > Thank you, Mark, for your reply.
> > > >
> > > > > However with
> > > > > *java.lang.Object*- what XML Schema type could that correspond to
> in
> > > > > order to get
> > > > > serialized/deserialized to by JAXB?
> > > >
> > > > Well, I've found out that JAXB is able to do it, anyway.
> > > >
> > > > The error message reminded me that in the past there had been
> problems
> > > > with serialization of interfaces. So, in desperation, I changed the
> > > Map<,>
> > > > to HashMap<,> and afterwards the error message changed to
> > > >
> > > > class java.util.ArrayList nor any of its super class is known to this
> > > > context.
> > > >
> > > > So, I changed the List<> to ArrayList<> in the signature of the web
> > > service
> > > > method and now the web service works again.
> > > >
> > > > Of course, this "solution" is extremely ugly, so if somebody has some
> > > > suggestions on how to fix the problem without resorting to signatures
> > > with
> > > > concrete classes, please share your insights.
> > > >
> > > > Thanks!
> > > >
> > > >
> > > >
> > >
> >
>

Reply via email to