on 09-29-2014 8:36 AM
Hi experts,
I have an inbound XML file from a third party which PI is supposed to read and validate.
when the sender channel picks up the file it throws the error:
Error:
com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: XML
Validation for payload with root element name ConfigRequests , target namespace
Failed!Errors Encountered During Parsing 1.cvc-elt.1: Cannot find the
declaration of element 'ConfigRequests'.
i have tried processing he same file with ns1: and it passes successfully in PI
Can PI read an XML without the "ns1" tag.
Hi Tanzoom,
'ns1' is not a tag but a namespace prefix. It stands for a namespace and is part of the identity of an xml element. ConfigRequests was simply not validated because it was not in the right namespace. Which prefix you use, doesnt matter. Only the represented value - the namespace - is important.
/Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Javier,
My sturcture looks like below. Both the source an Target is same , as i just need to validate (schema validation) the source XML in PI and pass it on
<?xml version="1.0" standalone="yes"?><ConfigRequests ParticipantID="ABC">
<ConfigRequest>
<MpanMprn>123</MpanMprn>
<MeterSerialNumber>METER5</MeterSerialNumber>
<Configs>
<TariffConfig>
<SetTariff>
<fromTariffRef>R1</fromTariffRef>
<toTariffRef>R2</toTariffRef>
<effectiveDate>2011-09-09</effectiveDate>
</SetTariff>
</TariffConfig>
</Configs>
</ConfigRequest>
<ConfigRequest>
<MpanMprn>220</MpanMprn>
<MeterSerialNumber>D13A011524</MeterSerialNumber>
<Configs>
<TariffConfig>
<SetTariff>
<fromTariffRef>OLDTAR1</fromTariffRef>
<toTariffRef>NEWTAR2</toTariffRef>
<effectiveDate>2014-09-17</effectiveDate>
</SetTariff>
</TariffConfig>
</Configs>
</ConfigRequest>
</ConfigRequests>
Since the structure doesnot have the ns1: tag, the channel throws the below error while XSD validation
MP: exception caught with cause
com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: XML
Validation for payload with root element name ConfigRequests , target namespace
Failed!Errors Encountered During Parsing 1.cvc-elt.1: Cannot find the
declaration of element 'ConfigRequests'.
the file copied above is the Actual file , without any name space
<?xml version="1.0" standalone="yes"?><ConfigRequests ParticipantID="ABC">
<ConfigRequest>
<MpanMprn>123</MpanMprn>
<MeterSerialNumber>METER5</MeterSerialNumber>
<Configs>
<TariffConfig>
<SetTariff>
<fromTariffRef>R1</fromTariffRef>
<toTariffRef>R2</toTariffRef>
<effectiveDate>2011-09-09</effectiveDate>
</SetTariff>
</TariffConfig>
</Configs>
</ConfigRequest>
<ConfigRequest>
<MpanMprn>220</MpanMprn>
<MeterSerialNumber>D13A011524</MeterSerialNumber>
<Configs>
<TariffConfig>
<SetTariff>
<fromTariffRef>OLDTAR1</fromTariffRef>
<toTariffRef>NEWTAR2</toTariffRef>
<effectiveDate>2014-09-17</effectiveDate>
</SetTariff>
</TariffConfig>
</Configs>
</ConfigRequest>
</ConfigRequests>
My external Definition doesnot have any namespace in it. Below is the schema
<?xml version="1.0" encoding="utf-8"?>
<!--Created with Liquid XML Studio Designer Edition 8.1.2.2399 (http://www.liquid-technologies.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="ConfigRequests">
<xs:complexType>
<xs:sequence>
<xs:element name="ConfigRequest" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="MpanMprn" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="13"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="MeterSerialNumber" minOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Configs">
<xs:complexType>
<xs:sequence>
<xs:element name="NonDisconnectMeterConfig" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="NonDisconnectConfigID" minOccurs="1" maxOccurs="1">
<!--<xs:annotation>
<xs:documentation xml:lang="EN">This is the
period identifier that is defined by the supplier in the
NonDisconnectConfig XML file. This will map to an
internal Instant Energy identifier, but the
customer/supplier does not need to know what our
internal number is.</xs:documentation>
</xs:annotation>-->
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string"/>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="effectiveDate" type="xs:date" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="HolidayMeterConfig" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="HolidayConfigID" minOccurs="1" maxOccurs="1">
<!--<xs:annotation>
<xs:documentation xml:lang="EN">This is the
holiday identifier that is defined by the supplier in
the HolidayConfig XML file. This will map to an internal
Instant Energy identifier, but the customer/supplier
does not need to know what our internal number is.
</xs:documentation>
</xs:annotation>-->
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string"/>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="effectiveDate" type="xs:date" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TariffConfig" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:choice>
<xs:element name="SetTariff">
<!--<xs:annotation>
<xs:documentation xml:lang="EN">This is the 'Set Tariff' option for the tariff configuration. This will allow the tariff on a meter to be changed from one tarrif ID to anther tariff ID.</xs:documentation>
</xs:annotation>-->
<xs:complexType>
<xs:sequence>
<xs:element name="fromTariffRef" minOccurs="1" maxOccurs="1">
<!--<xs:annotation>
<xs:documentation xml:lang="EN">This is the expected existing tariff ID on the meter that will be validated against and will changed to a new tariff ID.</xs:documentation>
</xs:annotation>-->
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="toTariffRef" minOccurs="1" maxOccurs="1">
<!--<xs:annotation>
<xs:documentation xml:lang="EN">This is the new tariff ID that the meter will be changed to.</xs:documentation>
</xs:annotation>-->
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="effectiveDate" type="xs:date" minOccurs="1" maxOccurs="1">
<!--<xs:annotation xml:lang="EN">
<xs:documentation>This is the effective from date for the commencement of the new tariff</xs:documentation>
</xs:annotation>-->
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RefreshTariff">
<!--<xs:annotation xml:lang="EN">
<xs:documentation xml:lang="EN">This is the 'Refresh Tariff' option for the tariff configuration. This will allow the existing tariff ID on a meter to be updated to reflect any changes to the details for that tariff.</xs:documentation>
</xs:annotation>-->
<xs:complexType>
<xs:sequence>
<xs:element name="tariffRef" minOccurs="1" maxOccurs="1">
<!--<xs:annotation>
<xs:documentation xml:lang="EN">This is the tariff ID that is expected to be on the meter and will be updated to reflect any changes to the details for that tariff.</xs:documentation>
</xs:annotation>-->
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="effectiveDate" type="xs:date" minOccurs="1" maxOccurs="1">
<!--<xs:annotation>
<xs:documentation xml:lang="EN">This is the effective from date for the commencement of the updated tariff details.</xs:documentation>
</xs:annotation>-->
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="responseStatus" type="ResponseStatusDT" minOccurs="0"/>
<xs:element name="rejectionReason" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="200"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="ParticipantID" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="ResponseStatusDT">
<xs:restriction base="xs:string">
<xs:enumeration value="Success"/>
<xs:enumeration value="Failed"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
Test 1
1. Remove XMLAnonymizer module
2. Deactivate schema validation at ICO configuration
3. Test again.
Test 2
1. Activate schema validation
If doesn't work, refer to Sreenivas thread: http://scn.sap.com/thread/74777 because your schema includes elementFormDefault="qualified"
Test 3.
Modify the schema manually removing that line (elementFormDefault="qualified") and test again
If it works, the problem is the schema. Maybe you can contact to provider to remove that string
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.