on 02-09-2012 10:05 AM
Hello Everyone,
I have an error during the validation, and I don't now where is the problem.
The error is :
<SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30"
xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SAP:Category>XIServer</SAP:Category>
<SAP:Code area="XML_VALIDATION_INB">CX_XMS_SYSERR_VALIDATION</SAP:Code>
<SAP:P1>com.sap.aii.utilxi.xmlvalidation.impl.XMLValidationException: XML Validation for payload with root element
name Orders , target namespace Failed!Errors Encountered During Parsing 1.cvc-elt.1: Cannot find the
declaration of element 'Orders'.</SAP:P1>
<SAP:P2>XML Validation for payload with root element name Orders , target namespace Failed!Errors Encountered
During Parsing 1.cvc-elt.1: Cannot find the declaration of element 'Orders'.</SAP:P2>
<SAP:P3>Schema Not Available in Cache, try to validation with file system schemas. Validation With File System
schemas also Failed. XML Validation for payload with root element name Orders , target namespace
Failed!Errors Encountered During Parsing 1.cvc-elt.1: Cannot find the declaration of element 'Orders'.
</SAP:P3>
<SAP:P4/>
<SAP:AdditionalText>not used at the moment.</SAP:AdditionalText>
<SAP:Stack>System error occurred during XML validation</SAP:Stack>
</SAP:Error>
The XSD File for the validation is the following
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://site.be/Commandes" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://site.be/Commandes">
<xsd:element name="Orders" type="Orders"/>
<xsd:complexType name="Orders">
<xsd:annotation>
<xsd:documentation xml:lang="EN">DT_Orders</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="ligne" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Field1" type="xsd:string"/>
<xsd:element name="Field2" type="xsd:string"/>
<xsd:element name="Field3" type="xsd:string"/>
<xsd:element name="Field4" type="xsd:string"/>
<xsd:element name="Field5" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Can someone give me some input to help me to resolve this problem ?
Thanks a lot
JC
Can you please enclose the example XML input that made this error?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Immanuel,
This is the XML
"<?xml version="1.0" encoding="utf-8" ?>
< Orders >
< ligne >
< Field1 >313< /Field1 >
< Field2 >2011121620 < /Field2 >
<Field3>1112190082</Field3>
<Field4>850000</Field4>
<Qte>02</Qte>
</ligne>
</Orders>"
This one has been created automaticaly by PI with a File Content Conversion in the communication for the File Sender , I have received a flat file from my partner.
And I have to create an Idoc (Orders05).
Thanks a lot for your help.
JC
Edited by: jconderbeke on Feb 9, 2012 11:34 AM
Please try to change the input to this:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Orders xmlns:ns0="http://site.be/Commandes">
<ligne>
<Field1>313</Field1>
<Field2>2011121620</Field2>
<Field3>1112190082</Field3>
<Field4>850000</Field4>
<Field5>02</Field5>
</ligne>
</ns0:Orders>
meaning - add the ns0 to the root element.
the error indicates that you have the target namespace missing.
you can use rwb in order to send the message instead of the file adapter.
If it doesn't work - please tell me if you get the same error or a different one.
you can also try to change your external definition so that the xsd will look like Grzegorz Glowacki said,
this will mean that a target namespace is not reuired.
good luck,
Imanuel Rahamim.
Edited by: Imanuel Rahamim on Feb 9, 2012 1:08 PM
Edited by: Imanuel Rahamim on Feb 9, 2012 1:14 PM
Hi,
Nice one, Imanuel, I haven't noticed that before. It is just the namespace that causes the error (I thought this was related to the way this element was declared in the xsd). So in the xsd file it is enough to delete both of these:
targetNamespace="http://site.be/Commandes"
xmlns="http://site.be/Commandes"
Adding a namespace to the xml data looks more complicated, as jconderbeke is using FCC. But you are right, this also solves the problem.
Greg
Hi,
Most probably your FCC parameters do not match the .xsd file that you use to validate the input. Try switching off the validation temporarily and see what is your input after FCC conversion, then adjust the FCC parameters and switch on the validation again.
Hope this helps,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How about a slight change to the xsd? Try with the following, it seems to work fine:
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Orders" type="Orders"/>
<xsd:complexType name="Orders">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="ligne">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Field1" type="xsd:string" />
<xsd:element name="Field2" type="xsd:string" />
<xsd:element name="Field3" type="xsd:string" />
<xsd:element name="Field4" type="xsd:string" />
<xsd:element name="Qte" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:schema>
You might also find this tool useful for testing such scenarios:
http://xsdvalidation.utilities-online.info/
By the way - how did you get the xsd that you are currently using?
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.