I'm not sure what your exact requirement is, but I
can tell you about something similar I've done.
I wrote a serializer/deserializer for sparse arrays
according to the SOAP v1.1 spec. In that case, I
needed to add an XML attribute to each serialized
item from the array in order to specify its position
in the sparse array. So, I managed this stuff
inside the implementation of the marshal(...) method.
One of the parameters is named "sink" and it's of
type "Writer". Bingo! There's your chance to write
anything you want to the stream. So ther's your chance
to add an XML attribute.
I hope this helps.
Rob
-----Original Message-----
From: "Tom O'Connor" <[EMAIL PROTECTED]>
Date: Thu, 19 Jul 2001 18:14:48 -0400
Subject: parameters, attributes, custom de/serializers
> I've seen this question asked multiple times in multiple ways and
> haven't seen a complete answer:
>
> Q: When using soapencoding for message Parameters, how does one write
> data as an XML attribute? I.E:
>
> <foo bar="rab">oof</foo>
>
> The expected answer is "write your own Serializer/Deserializer class"
> which makes complete sense. However, I haven't seen any examples of
> how to use the encoding helper classes (like SoapEncUtils) to
> actually
> do the encoding/decoding.
>
> All the "sample" serializers immediately call nsStack.pushScope()
> followed shortly thereafter by
> SoapEncUtils.generateStructureHeader().
> From what I can tell, SoapEncUtils.generateStructureHeader() closes
> the XML element before and attributes could be written.
>
> Does this mean that one has to replicate the functionality of
> generateStructureHeader in a custom serializer to allow XML
> attributes
> to be included in the encoding? Seems like a lot of extra work. Or
> am I completely missing something and adding attributes into the
> encoding is trivial?
>
>
>