[ 
http://jira.codehaus.org/browse/JIBX-339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dennis Sosnoski updated JIBX-339:
---------------------------------

    Assignee: Dennis Sosnoski

JiBX works within Axis2 using the code generated by WSDL2Java, but you can also 
use it separately (which is what I assume you're doing).

All of the IMarshallingContext.marshalDocument() method variations do close the 
stream, which is normally what you want to do when you're creating a document 
directly. To stream out XML which can be embedded within another document you 
need to instead call the lower-level methods used by marshalDocument(): some 
variation of setOutput() or setXmlWriter(), followed by the actual marshalling 
of your root object (cast it to IMarshallable, then call the marshal() method 
of the cast type), followed by a flush() call on the IXMLWriter (which you can 
get, if you didn't set it directly, but calling the 
IMarshallingContext.getXmlWriter() method).

Hopefully this takes care of your issue, and we can close this as not-a-bug.

> MarshallingContext closes Writer at endDocument.
> ------------------------------------------------
>
>                 Key: JIBX-339
>                 URL: http://jira.codehaus.org/browse/JIBX-339
>             Project: JiBX
>          Issue Type: Bug
>         Environment: JDK 1.6 under MAC OSX 1.5.8
>            Reporter: Benoit Callebaut
>            Assignee: Dennis Sosnoski
>
> Upon marshalling, Marshalling context closes its writer when it encounter 
> endDocument event.
> When using an XMLStreamWriter through StaxWriter, the XMLStreamWriter is 
> closes.
> This causes trouble when you need to use it afterwards.
> Test case is when using JiBX as XML framework in Axis2. Axis2 uses the 
> XMLStreamWriter afterwards to finish the SOAP message. This throws an 
> Exception.
> Workaround is to filter out the close call.
> Possible solution is to remove the code in the close method of StAXWriter

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
jibx-devs mailing list
jibx-devs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to