What I did was to create
a temporary sink for the element of the array to be serialized
to. That way I could add what I needed and copy the rest
from the temporary sink. Again, I did this inside the marshall
method of the array serializer. This works for an array serializer
because each element is surrounded by an <item> tag which I am
in total control of right there in the marshall method. This was easy
since the array serializer then calls the element serializer.
In the case of serializer for a single element, you'll have to take
a slightly different approach. Here's a possible way to do it:
Since the context parameter passed to the marshall method of the
serializer is actually the name of the element, you could create
a modified name context before calling the generateStructureHeader.
So you could add the parameters right there and pass the concatenated
name as the context. Be sure not to simply modify the context
parameter itself because it's used to create the closing element tag as
well and you wouldn't want the parameters to appear there too.
I think I did this but I honestly can't find the code. Anyway, if
this isn't exactly right, I think it'll give you enough to finish
it up.
-----Original Message-----
From: "Tom O'Connor" <[EMAIL PROTECTED]>
Date: Fri, 20 Jul 2001 09:13:45 -0400
Subject: RE: parameters, attributes, custom de/serializers
> So in your sparse array serializer, did you use the
> SoapUtilEnc.generateStructureHeader() call like all the other
> "sample"
> serailizer/deserializers do, or did you have to replicate that
> functionality yourself?
>
> From what I read, the generateStructureHeader() opens and element
> tag,
> writes the element name, namespace attributes, datatype attributes,
> then closes the element tag. All this data is written to "sink" and
> there doesn't seem to be a way to get that call to write out any user
> defined attributes.
>
>