[ 
https://issues.apache.org/jira/browse/OLINGO-994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15435379#comment-15435379
 ] 

Dmitry Tretyakov commented on OLINGO-994:
-----------------------------------------

[~mirbo], in our case com.sun.xml.internal.stream.writers.XMLStreamWriterImpl 
from JDK 1.8.0_66 in #writeEndElement does following:
{code}
public void writeEndElement() throws XMLStreamException {
        try {
            if(this.fStartTagOpened) {
                this.closeStartTag();
            }

            XMLStreamWriterImpl.ElementState e = this.fElementStack.pop();
            if(e == null) {
                throw new XMLStreamException("No element was found to write");
            } else if(!e.isEmpty) {
                this.fWriter.write("</");
                if(e.prefix != null && !e.prefix.equals("")) {
                    this.fWriter.write(e.prefix);
                    this.fWriter.write(":");
                }

                this.fWriter.write(e.localpart);
                this.fWriter.write(62);
                this.fInternalNamespaceContext.popContext();
            }
        } catch (IOException var2) {
            throw new XMLStreamException(var2);
        } catch (ArrayIndexOutOfBoundsException var3) {
            throw new XMLStreamException("No element was found to write: " + 
var3.toString(), var3);
        }
    }
{code}
because ElementState.isEmpty is always false. And it cause creation of:
{code}
<content ...></content>
{code}

> Xml content element in Atom entry is not compatible with WCF OData client
> -------------------------------------------------------------------------
>
>                 Key: OLINGO-994
>                 URL: https://issues.apache.org/jira/browse/OLINGO-994
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-core
>    Affects Versions: V2 2.0.6, V2 2.0.7
>            Reporter: Dmitry Tretyakov
>            Priority: Critical
>              Labels: easyfix
>             Fix For: V2 2.0.8
>
>         Attachments: npm.png
>
>
> Currently 
> [AtomEntryEntityProducer|https://github.com/apache/olingo-odata2/blob/bef01c2881fff1e76c84c803fda041d4987dc8eb/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryEntityProducer.java#L409-L412]
>  creates start and end tags for entry's content like that:
> {code:xml}
> <content type="application/zip" 
> src="https://www.nuget.org/api/v2/package/WindowsAzure.StorageExtensions/1.0.2";></content>
> {code}
> and it's not compatible with WCF OData client which expects that content 
> element with *src* attribute [must not have 
> value|http://referencesource.microsoft.com/#System.Data.Services.Client/Client/System/Data/Services/Client/AtomParser.cs,540].
> Example entry from the nuget feed:
> https://www.nuget.org/api/v2/Packages(Id='WindowsAzure.StorageExtensions',Version='1.0.2')
> where content element looks as follows:
> {code:xml}
> <content type="application/zip" 
> src="https://www.nuget.org/api/v2/package/WindowsAzure.StorageExtensions/1.0.2";
>  />
> {code}
> !npm.png|width=100%!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to