cancel
Showing results for 
Search instead for 
Did you mean: 

Adapter module - problem with XML

Former Member
0 Kudos

Hi all

I have written an adapter module for the sender jdbc adapter(it shouldn't matter which adapter) that converts the content into xml by addressing each byte of the message content.

I am able to make the xml but when the message reaches the integration server it throws up a mapping exception. When I look at the payload in SXI_MONITOR it says -

Invalid at the top level of the document. Error processing resource 'file:/// ........

But when I right click on the payload and do "view source" and then save the text document and then refresh the payload in the payload window it shows me the xml document.

Would you have any idea as to why the IS doesn't recognise the message to be an xml message?

Thanks a lot

Salil

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for all your responses.

I've managed to work it out. After the initial <?xml tag the document needs a carriage return. I guess it's a way of ensuring that the top of the XML document contains only the <?xml declaration.

Thanks

Salil

Former Member
0 Kudos

Hi Bhavesh

Yup it's a perfectly valid xml. I tried saving it as a file to my desktop and it opened fine in my browser. As I mentioned earlier even when I do a "view source" of the payload and then save that and subsequently refresh the payload it shows up fine too.

Actually here is the payload. i am wondering if all it needs is a carriage return after the <?xml tag.

<?xml version="1.0" encoding="utf-8"?> <ns0:out_sale_mt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://www.rd1.com/pos/sales"><TransHeaders><ID>1782219</ID><TransNo>2</TransNo><Branch>91</Branch><Station>99</Station><Receipt>0910990000002</Receipt><Logged>2007-08-02T18:52:53</Logged><TransType>C</TransType><TransStatus>C</TransStatus><TheUser>cantlong</TheUser><Customer>100001006</Customer><CustType>C</CustType><SecondCustomer></SecondCustomer><SecondCustCard></SecondCustCard><LinesNo>2</LinesNo><PaymentsNo>1</PaymentsNo><TotalBeforeTax>2.8400</TotalBeforeTax><TotalAfterTax>3.1900</TotalAfterTax><ScannedNo>0</ScannedNo><ScanTime>0</ScanTime><PayTime>0</PayTime><IdleTime>0</IdleTime><Reason>0</Reason><Rounding>0.0000</Rounding><TH_FieldText1></TH_FieldText1><TH_FieldText2></TH_FieldText2><TH_FieldText3></TH_FieldText3><System1>0</System1><System2>0.0000</System2><System3></System3><FolioID>0</FolioID><UserAcc>1</UserAcc><Salesperson></Salesperson><TransLines xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://www.rd1.com/pos/sales"><TransNo>2</TransNo><Branch>91</Branch><Station>99</Station><Line>1</Line><LineType>N</LineType><UPC>9400559001014</UPC><IsVoided>0</IsVoided><Quantity>1.0000</Quantity><Price>3.1900</Price><DiscountID>0</DiscountID><TaxNo>1</TaxNo><SubBeforeTax>2.8356</SubBeforeTax><SubAfterTax>3.1900</SubAfterTax><Reason>0</Reason><Note/><TL_FieldText1/><TL_FieldText2/><TL_FieldText3/><SerialNumber/><TransStatus>C</TransStatus><Cost>2.4000</Cost><PriceSet>3.1900</PriceSet><TaxNo1>1</TaxNo1><TaxNo2>0</TaxNo2><TaxNo3>0</TaxNo3><TaxAmount1>0.3544</TaxAmount1><TaxAmount2>0.0000</TaxAmount2><TaxAmount3>0.0000</TaxAmount3><CostProtect xsi:nil="true"/><Location>0</Location><ESMPack>0</ESMPack></TransLines><TransPayments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://www.rd1.com/pos/sales"><TransNo>2</TransNo><Branch>91</Branch><Station>99</Station><Line>1</Line><MediaID>9</MediaID><MediaName>SPLIT</MediaName><Value>3.1900</Value><Fee>0.0000</Fee><Change>0.0000</Change><MediaNumber/><TP_FieldText1/><Rate>0.000000000</Rate><FCValue>0.0000</FCValue></TransPayments><PostCapture xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://www.rd1.com/pos/sales"><Id>168165</Id><Type/><TransStatus>C</TransStatus><TransNo>2</TransNo><Branch>91</Branch><Station>99</Station><Line>0</Line><IsVoided>0</IsVoided><Logged>2007-08-02T18:52:54</Logged><TheUser>cantlong</TheUser><Status>0</Status><UPC/><Note1/><Note2/><LineBucket>1</LineBucket><Bucket>&amp;lt;capture&amp;gt;&amp;lt;splits&amp;gt;&amp;lt;split&amp;gt;&amp;lt;code&amp;gt;100001006&amp;lt;/code&amp;gt;&amp;lt;percent&amp;gt;50&amp;lt;/percent&amp;gt;&amp;lt;/split&amp;gt;&amp;lt;split&amp;gt;&amp;lt;code&amp;gt;100001030&amp;lt;/code&amp;gt;&amp;lt;percent&amp;gt;50&amp;lt;/percent&amp;gt;&amp;lt;/split&amp;gt;&amp;lt;/splits&amp;gt;&amp;lt;/capture&amp;gt;</Bucket></PostCapture></TransHeaders></ns0:out_sale_mt>

Former Member
0 Kudos

when i opened in IE the structure under the node <Bucket> seems to be taken as value for bucket element. wud there b any problem in this structure?

As I mentioned earlier even when I do a "view source" of the payload and then save that and subsequently refresh the payload it shows up fine too

did u check the payload u get after refreshing with the one u had pasted. open both in IE and check if there is any difference

bhavesh_kantilal
Active Contributor
0 Kudos

Salil,

Are you sure this is a XML? Can you download the payload as a file and then check if this is a XML file? Open it in a bowser like IE and see if is a valid XML

Regards

Bhavesh