Skip to Content
0

Cloud Integration OData Post error: Message: Metadata error

Nov 19, 2017 at 11:50 AM

541

avatar image

Hi,

I am getting this strange error when trying to Post an XML towards SAP using the OData adapter in SAP cloud platform integration.

The complete error in message monitoring is this:

com.sap.gateway.core.ip.component.odata.exception.OsciException: setEdmService() : Metadata parsing failed An exception of type 'XMLStreamException' occurred., cause: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,335]
Message: The element type "meta" must be terminated by the matching end-tag "</meta>".


The Odata service is provisioned by SCP, so we are not using an on-premise gateway.

The XML itself has been mapped towards the structure imported from the OData adapter itself so is structurally sound compared to the OData service.

<?xml version="1.0" encoding="UTF-8"?><SalesOrderSet>
  <SalesOrder>
    <OrderToItems>
      <SalesOrderItem>
        <Material>V20504400</Material>
        <ReqQuantity>5</ReqQuantity>
      </SalesOrderItem>
      <SalesOrderItem>
        <Material>V2058700</Material>
        <ReqQuantity>12</ReqQuantity>
      </SalesOrderItem>
    </OrderToItems>
    <City>Oudegein</City>
    <Customer>50169000</Customer>
    <PostlCode>3432 TZ</PostlCode>
    <CountryIso>NL</CountryIso>
    <Street>Op 't Hoekje</Street>
    <Yourreference>Customer reference</Yourreference>
    <Custpurchasenumber>123456789</Custpurchasenumber>
    <Documentdate>2017-11-10</Documentdate>
    <Division>10</Division>
    <DistrChan>10</DistrChan>
    <SalesOrg>1000</SalesOrg>
    <DocType>TO</DocType>
  </SalesOrder>
</SalesOrderSet>

The source xml does not contain any meta tags. Also I wonder what the [row,col]:[1,335] is about. I cannot relate that to the source message.

The OData service configuration looks like this

The Tail log via eclipse does not really show more information, maybe this string

Metadata parsing failed <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"><meta http-equiv="pragma" content="no-cache" /></head><

Position 335 of this string starts at /head

The rest of the tail logging is just the olingo stack trace

Caused by: org.apache.olingo.odata2.api.ep.EntityProviderException: An exception of type 'XMLStreamException' occurred.
	at org.apache.olingo.odata2.core.ep.consumer.XmlMetadataConsumer.readMetadata(XmlMetadataConsumer.java:122)
	at org.apache.olingo.odata2.core.edm.provider.EdmxProvider.parse(EdmxProvider.java:51)
	at org.apache.olingo.odata2.core.ep.ProviderFacadeImpl.readMetadata(ProviderFacadeImpl.java:231)
	at org.apache.olingo.odata2.api.ep.EntityProvider.readMetadata(EntityProvider.java:876)
	at com.sap.gateway.core.ip.component.odata.cache.CacheEdmProvider.setEdmService(CacheEdmProvider.java:154)
	... 72 common frames omitted
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,335]
Message: The element type "meta" must be terminated by the matching end-tag "</meta>".
	at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:601)
	at org.apache.olingo.odata2.core.ep.consumer.XmlMetadataConsumer.readMetadata(XmlMetadataConsumer.java:96)
	... 76 common frames omitted
|
2017 11 19 11:08:12#+00#ERROR#com.sap.it.op.agent.mpl.sink.AbstractMessageProcessingLogSink##S0015718934#output#na#avrhcip#l20125iflmap#web#ab1b53439#na#na#na#na#Erroneous message: AFoRZhuMfv70peuLKKHBbyrvW6jl,FAILED,TR_Sales_order1,MessageFlow_63,LastError: [com.sap.it.rt.adapter.http.api.exception.HttpResponseException: An internal server error occured: setEdmService() : Metadata parsing failed An exception of type 'XMLStreamException' occurred..
The MPL ID for the failed message is : AFoRZhuMfv70peuLKKHBbyrvW6jl

The OData service itself has already been successfully tested locally on SAP and via a REST call in Postman.

Any ideas why we get this error?

Thanks,

Tom

odata-config.jpg (50.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Kevin Teeling
Nov 28, 2017 at 10:38 AM
0

It seems there is HTML being fed into an XML parser.

You can see;

"Metadata parsing failed <!DOCTYPE html ..."

And;

"Caused by: org.apache.olingo.odata2.api.ep.EntityProviderException: An exception of type 'XMLStreamException ..."

An XML parser will not be able to parse HTML.

There are usually "<meta>" tags in an HTML documents <head> section which don't require closing tags, hence the error.

If the message flow is:

HCI [OData Adapter] <-> Odata Provisioning Service (gwaas endpoint) <-> Cloud Connector <-> On Premise System.

It's probably the Odata Provisioning Service (gwaas endpoint) returning the HTML instead of XML to HCI.

For example; the gwaas service might be trying to return an HTML page containing an error message.

Share
10 |10000 characters needed characters left characters exceeded
Tom van Rooijen Nov 30, 2017 at 06:36 PM
0

Hi Kevin,

Thanks for your answer. In fact this metadata error says exactly what the error is, namely a problem with the metadata of the odata service being called. After a refresh of the metadata & xsd's the error disappeared.

Regards

Tom

Share
10 |10000 characters needed characters left characters exceeded