on 12-14-2014 7:16 AM
Hi Friends,
my client provide xml file based on this i need to create structure.
XML File
<?xml version="1.0" encoding="utf-16"?>
<InventoryResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" MajorVersion="1" xmlns="http://retalix.com/R10/services">
<Header>
<Response ResponseCode="OK" />
</Header>
<InventoryAction ActionCode="Get" Type="Receiving">
<Id>45bf1063-4018-4a5a-a341-634034465da1</Id>
<Description>35083074279</Description>
<GenerationMethod Source="Manual">Manual</GenerationMethod>
<DateTime TypeCode="EffectiveDate">2014-11-03T21:48:33</DateTime>
<DateTime TypeCode="CreationDate">2014-11-03T21:48:33</DateTime>
<DateTime TypeCode="DeliveryDate">2014-11-03T21:48:33</DateTime>
<InventoryItem>
<ItemID Name="BLUE BELL DPPD STRW">0007189962261</ItemID>
<Quantity>6.00000000</Quantity>
<QuantityForInventoryBalance xsi:type="InventoryItemQuantityType">6.00000000</QuantityForInventoryBalance>
<CostForInventoryBalance>2.1000</CostForInventoryBalance>
<InventoryBalance>11.000</InventoryBalance>
<InventoryPackage>
<Package Ratio="1.00000" UnitOfMeasure="Each" Name="BLUE BELL DP" Cost="2.10000" EntityKey="1197345">0007189962261</Package>
<Quantity>6.000</Quantity>
<AdditionalQuantity>1</AdditionalQuantity>
<Operator>shirim</Operator>
<Comment />
<DateTime TypeCode="EffectiveDate">2014-11-03T21:49:56</DateTime>
<GenerationMethod Source="Manual">Manual</GenerationMethod>
<IsDefault>true</IsDefault>
<Cost>2.1000</Cost>
</InventoryPackage>
</InventoryItem>
<Operator>shirim</Operator>
<ApproveOperator>shirim</ApproveOperator>
<Scope>
<InventoryLocation>
<BusinessUnit Name="Brooklyn">0002</BusinessUnit>
<BusinessUnit Name="Blue Bell Creameries" TypeCode="Supplier">502230</BusinessUnit>
</InventoryLocation>
</Scope>
<Totals Lines="2" Items="2" Quantity="0" Cost="424.0000000" NumberOfGeneratedPackages="0" NumberOfReceivedPackages="7.000" />
<Discrepancies xmlns=""><![CDATA[<?xml version="1.0" encoding="utf-16"?>
<ReceivingDiscrepancyLog xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<StoreId>1</StoreId>
<SupplierId>1</SupplierId>
<SupplierName>Mclane</SupplierName>
<OrderDate xsi:nil="true" />
<ReceivingDate>2014-11-15T21:48:33</ReceivingDate>
<TotalGeneratedQuantity>0</TotalGeneratedQuantity>
<Lines>
<ReceivingDiscrepancyLogLine>
<DsdSequenceNumber>0</DsdSequenceNumber>
<UnitOfMeasure>CA</UnitOfMeasure>
<ItemId>484129RATIO5</ItemId>
<Quantity>4.000</Quantity>
</ReceivingDiscrepancyLogLine>
<ReceivingDiscrepancyLogLine>
<DsdSequenceNumber>0</DsdSequenceNumber>
<UnitOfMeasure>CA</UnitOfMeasure>
<ItemId>484123RATIO10</ItemId>
<Quantity>3.000</Quantity>
</ReceivingDiscrepancyLogLine>
</Lines>
</ReceivingDiscrepancyLog>]]></Discrepancies>
</InventoryAction>
</InventoryResponse>
Based on XML I created bellow structure
MT_sample
Inventoryresponse
Header
Response element
Responsecode Attribute
InventoryAction 0..1
ActionCode Attribute
Type Attribute
Id element
Description element
GenerationMethod element
Source Attribute
DateTime element 0....Unbound
TypeCode Attribute
<InventoryItem> 0....Unbound
temID
.........
But It showing error
Cannot create target element /ns0:TR_MT. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD
please help me How to start creating my structure.
when I place the xml structure in mapping, its showing all field are turn into RED colour.
Thanks,
BhanuPrakash
Hi,
You can also use the online tool for XSD creation from your XML:
Free Online XSD/XML Schema Generator From XML - FreeFormatter.com
Regards,
Azhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It would be good to ask the client for xsd structure because the xml might not have all the fields covered (some optional fields might be missing in the xml). Even if you create the xsd structure by generating it via an tool there is still a risk as i mentioned.
The error you have mentioned is due to a mandatory field not populated for the generation of field "TR_MT". Please check if the field is mapped and the source field supplies a value to this target field.
Thanks,
Sudhansu
Hi Bhanu,
You could use ALTOVA AMLSPY tool to convert your XML file to XSD document.
Steps Involved:
Go to main menu -> DTD/Schema -> Generate DTD/Schema
Please find below the link to know more on the tool:
Let us know if this was helpful for you.
Thanks
Sujitha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Bhanu,
If possible ask XSD from your client or check if any tool is present which can provide you XSD from XML and then import it as external definition in ESR.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.