I'm doing some similar things in the JibxSoap WSDL generation. I'm trying right now to get JiBX beta 3c ready, and when that's done I'll also release JibxSoap.

 - Dennis

Stefano Fornari wrote:

Hi All,
We would like to follow the suggestion of writing a marshaller to work around our namespace problem. However, from the docs, it is not very clear how to do it.
We would like an output like:


<Type xmlns="syncml:metinf">something</Type>

without specifying the ns in the mapping.

We figured out the skeleton of the marshaller should look like the following:

public class MetInfTypeMarshaller implements IMarshaller
{
    public boolean isExtension(int index) {
        return false;
    }

    public void marshal(Object obj, IMarshallingContext ictx)
        throws JiBXException {

        if (obj == null) {
            return;
        }

        MarshallingContext ctx = (MarshallingContext)ictx;

        IXMLWriter writer = ctx.getXmlWriter();

writer.pushExtensionNamespaces(new String[] {"syncml:metinf"});
writer.startTagNamespaces(*, "Type", *, *); // what should we put here instead of * ????
writer.closeStartTag();
writer.writeTextContent(obj.toString());
writer.endTag(*, "Type"); // what should we put here instead of * ????
writer.popExtensionNamespaces();
}


}

Is it correct? What should we put instead of the * bookmarks?

Any hint is very much appreciated.

Thanks in advance.

Stefano & Luigia




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users






-- Dennis M. Sosnoski Enterprise Java, XML, and Web Services Training and Consulting http://www.sosnoski.com Redmond, WA 425.885.7197




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to