Odata service and XML schema

0
Hello,   I am consuming an oData service from SAP and the output is coming in XML format. I tried to create the XSD file using different online XSD generator, so I could import the file in Mendix and use import mapping. But all of them did not work and generate different errors in Mendix. Sometimes I'm not even able to create the XML schema, saying something is not correct with the XSD file, and sometimes I was able to import the XSD, but when I execute the oData API, I'm not getting any result.   Did someone already have this kind of scenario that could support me?   The XML I'm getting is the one bellow:   <?xml version="1.0" encoding="utf-8"?><entry xml:base="https://SAPE1IQAS-INDUSTRY.SIEMENS.NET:8090/sap/opu/odata/SIE/E_WM_I02273_QN_MNDX_SAP_SRV/" xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"><id>https://SAPE1IQAS-INDUSTRY.SIEMENS.NET:8090/sap/opu/odata/SIE/E_WM_I02273_QN_MNDX_SAP_SRV/QNDATASet(VENDOR='30134815',NOTIF_TYPE='F2',MATERIAL='RS%3A99001705493',MATERIAL_PLANT='M600')</id><title type="text">QNDATASet(VENDOR='30134815',NOTIF_TYPE='F2',MATERIAL='RS%3A99001705493',MATERIAL_PLANT='M600')</title><updated>2025-03-18T20:21:34Z</updated><category term="SIE.E_WM_I02273_QN_MNDX_SAP_SRV.QNDATA" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/><link href="QNDATASet(VENDOR='30134815',NOTIF_TYPE='F2',MATERIAL='RS%3A99001705493',MATERIAL_PLANT='M600')" rel="self" title="QNDATA"/><link href="QNDATASet(VENDOR='30134815',NOTIF_TYPE='F2',MATERIAL='RS%3A99001705493',MATERIAL_PLANT='M600')/NAV_QN_NOTIF_RETURN" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/NAV_QN_NOTIF_RETURN" type="application/atom+xml;type=feed" title="NAV_QN_NOTIF_RETURN"><m:inline><feed xml:base="https://SAPE1IQAS-INDUSTRY.SIEMENS.NET:8090/sap/opu/odata/SIE/E_WM_I02273_QN_MNDX_SAP_SRV/"><id>https://SAPE1IQAS-INDUSTRY.SIEMENS.NET:8090/sap/opu/odata/SIE/E_WM_I02273_QN_MNDX_SAP_SRV/QNDATASet(VENDOR='30134815',NOTIF_TYPE='F2',MATERIAL='RS%3A99001705493',MATERIAL_PLANT='M600')/NAV_QN_NOTIF_RETURN</id><title type="text">QNRETURNSET</title><updated>2025-03-18T20:21:34Z</updated><author><name/></author><link href="QNDATASet(VENDOR='30134815',NOTIF_TYPE='F2',MATERIAL='RS%3A99001705493',MATERIAL_PLANT='M600')/NAV_QN_NOTIF_RETURN" rel="self" title="QNRETURNSET"/><entry><id>https://SAPE1IQAS-INDUSTRY.SIEMENS.NET:8090/sap/opu/odata/SIE/E_WM_I02273_QN_MNDX_SAP_SRV/QNRETURNSET(Type='S',Id='%2FSIE%2FE_WM0',Number='002')</id><title type="text">QNRETURNSET(Type='S',Id='%2FSIE%2FE_WM0',Number='002')</title><updated>2025-03-18T20:21:34Z</updated><category term="SIE.E_WM_I02273_QN_MNDX_SAP_SRV.QN_RETURN" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/><link href="QNRETURNSET(Type='S',Id='%2FSIE%2FE_WM0',Number='002')" rel="self" title="QN_RETURN"/><content type="application/xml"><m:properties><d:Type>S</d:Type><d:Id>/SIE/E_WM0</d:Id><d:Number>002</d:Number><d:Message>Notification created 000200187375</d:Message></m:properties></content></entry><entry><id>https://SAPE1IQAS-INDUSTRY.SIEMENS.NET:8090/sap/opu/odata/SIE/E_WM_I02273_QN_MNDX_SAP_SRV/QNRETURNSET(Type='S',Id='%2FSIE%2FE_WM0',Number='004')</id><title type="text">QNRETURNSET(Type='S',Id='%2FSIE%2FE_WM0',Number='004')</title><updated>2025-03-18T20:21:34Z</updated><category term="SIE.E_WM_I02273_QN_MNDX_SAP_SRV.QN_RETURN" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/><link href="QNRETURNSET(Type='S',Id='%2FSIE%2FE_WM0',Number='004')" rel="self" title="QN_RETURN"/><content type="application/xml"><m:properties><d:Type>S</d:Type><d:Id>/SIE/E_WM0</d:Id><d:Number>004</d:Number><d:Message>Task Code 0001 Updated for picking text and partner</d:Message></m:properties></content></entry><entry><id>https://SAPE1IQAS-INDUSTRY.SIEMENS.NET:8090/sap/opu/odata/SIE/E_WM_I02273_QN_MNDX_SAP_SRV/QNRETURNSET(Type='S',Id='%2FSIE%2FE_WM0',Number='006')</id><title type="text">QNRETURNSET(Type='S',Id='%2FSIE%2FE_WM0',Number='006')</title><updated>2025-03-18T20:21:34Z</updated><category term="SIE.E_WM_I02273_QN_MNDX_SAP_SRV.QN_RETURN" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/><link href="QNRETURNSET(Type='S',Id='%2FSIE%2FE_WM0',Number='006')" rel="self" title="QN_RETURN"/><content type="application/xml"><m:properties><d:Type>S</d:Type><d:Id>/SIE/E_WM0</d:Id><d:Number>006</d:Number><d:Message>Task Code 0001 Released</d:Message></m:properties></content></entry></feed></m:inline></link><content type="application/xml"><m:properties><d:VENDOR>30134815</d:VENDOR><d:NOTIF_TYPE>F2</d:NOTIF_TYPE><d:MATERIAL>RS:99001705493</d:MATERIAL><d:REV_LVL>A</d:REV_LVL><d:MATERIAL_PLANT>M600</d:MATERIAL_PLANT><d:EXT_REF_NUM>9124635033</d:EXT_REF_NUM><d:PO_NUM>4510742580</d:PO_NUM><d:PO_ITEM>00010</d:PO_ITEM><d:WORK_CTR_PLANT>M600</d:WORK_CTR_PLANT><d:WORK_CTR>R85</d:WORK_CTR><d:CODING_CODE>0001</d:CODING_CODE><d:I_SHORT_TXT/><d:SHORT_TXT>Damaged Part</d:SHORT_TXT><d:PRIORITY>5</d:PRIORITY><d:COMPLAINT_QTY>0.000</d:COMPLAINT_QTY><d:CODING_CODE_GRP>MORS</d:CODING_CODE_GRP><d:USER_GID>Z00XXXXX</d:USER_GID><d:EMAIL_ID>testuser@test.com</d:EMAIL_ID><d:I_PROB_CODE>E100</d:I_PROB_CODE><d:I_PROB_CODE_GRP>YE01</d:I_PROB_CODE_GRP><d:PIC_LOC_TASK_TEXT>Location Test</d:PIC_LOC_TASK_TEXT><d:DEVICE_ID/></m:properties></content></entry>
asked
1 answers
0

Hello Lucas,

 

Long time ago i experienced something similar and the problem was the different namespaces in the xml, while some system can handle that really good some systems cannot, i see there are different ones in your file as well, which probably also means multiple xsd files that refer to each other. 

 

xmlns="http://www.w3.org/2005/Atom" 
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices

Some explanation about this can be found here: https://www.codeproject.com/Articles/18455/XSD-Tutorial-Part-4-of-5-Namespaces

 

I am not sure if mendix evolved on this subject because i did not encounter this situation for a long, long time, but the solution back then was to replace the namespaces which is very dirty. 

 

See also:

https://docs.mendix.com/refguide/xml-schemas/

 

Hope this gives you some guidance,

 

Good luck!

answered