cancel
Showing results for 
Search instead for 
Did you mean: 

File Content Conversion Error

Former Member
0 Kudos

Hello,

I have Async. File receiver scenario in which the following is the XML message structure. This is received by the file adpater.

<ns1:MT_Info_File xmlns:ns1="urn:http://freemanco.com/xi/info_list">

<TYPE>

<FileItem>

<FileName>DD11022007</FileName>

</FileItem>

</TYPE>

<DATA>

<LineItem> <LineEntry>234567891234567890123456789012345678901234567890</LineEntry>

</LineItem>

<LineItem>

<LineEntry>95473523647586969587265245437586979798376524253586</LineEntry>

</LineItem>

<DATA>

<LineItem</ns1:MT_Info_File>

<u><b>I want to write only folowiing DATA structure to file. I do not want to wite contents of TYPE structure</u>

<DATA>

<LineItem> <LineEntry>234567891234567890123456789012345678901234567890</LineEntry>

</LineItem>

<LineItem>

<LineEntry>95473523647586969587265245437586979798376524253586</LineEntry>

</LineItem>

<DATA></b>

In the receiver file adpater I have follwoing <u><b>File content conversion parameters</b></u>.

RecordSetStructure: DATA,LineItem,*

*.addHeaderLine 0

*.fieldFixedLengths 301

*.fixedLengthTooShortHandling Error

*.endSeparator nl

LineItem.fieldSeparator nl

DATA.fieldSeparator nl

While testing I got following error. Looks like it is expecting some values for FileItem element in the XML.

<b>Error</b> Attempt to process file failed with java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'FileItem' found in document', probably configuration error in file adapter (XML parser error)'

<b>Error</b> MP: exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'FileItem' found in document', probably configuration error in file adapter (XML parser error)': java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'FileItem' found in document', probably configuration error in file adapter (XML parser error)'

<b>Error</b> Exception caught by adapter framework: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'FileItem' found in document', probably configuration error in file adapter (XML parser error)'

<b>Error</b> Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'FileItem' found in document', probably configuration error in file adapter (XML parser error)': java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'FileItem' found in document', probably configuration error in file adapter (XML parser error)'.

How to resolve this issue? I appreciate your help.

Thank you,

Balaji

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Balaji,

i dont understand... the structure on the top - is it the source file?

Peter

Former Member
0 Kudos

Peter,

It is not a source file, it is the pay load coming in the XML format.

Thank you,

Balaji

Former Member
0 Kudos

ok, so is it a payload before mapping? or aftyer mapping?

Peter

Former Member
0 Kudos

Peter,

It is payload after mapping.

Thank you,

Balaji

Former Member
0 Kudos

Ok..

Questino is: Why is there the <TYPE> field in the target structure, if you don't want to write it in the file?

You problem can be solved by changing your target data type and appropriate mapping.

Peter

Former Member
0 Kudos

Peter,

I need to have TYPE structure because it contains the some information on filename and some other details. So I am using TYPE structure after mapping.

Thank you,

Balaji

Former Member
0 Kudos

But this structure can't be written by receiver file adapter..

So you are using TYPE for file name construction?

Peter

Former Member
0 Kudos

Peter,

Yes, I am using TYPE for file conversion. Problem is causing error while writing to file. Problem is with file content conversion.

Thank you,

Balaji

Answers (4)

Answers (4)

Former Member
0 Kudos

Balaji, it is not possible with this target structure!

Peter

Former Member
0 Kudos

Balaji,

I would suggest to remove FileItem and LineItem in your receiver datatype. They are increasing the hierarchy of your content conversion. If you do that then you will have

<ns1:MT_Info_File xmlns:ns1="urn:http://freemanco.com/xi/info_list">

<TYPE>

<FileName>DD11022007</FileName>

</TYPE>

<DATA><LineEntry>234567891234567890123456789012345678901234567890</LineEntry>

<LineEntry>95473523647586969587265245437586979798376524253586</LineEntry>

<DATA>

</ns1:MT_Info_File>

Then in content converstion give this parameters:

Record structure : TYPE,FileName,DATA,LineEntry

TYPE.fieldfixedlengths : 0

FileName.fieldfixedlenghts:0

DATA.fieldfixedlenghts:0

LineEntry.fieldfixedlengths:301

LineEntry.endSeparator:'nl'

Then it should work. Also you can use FileName in your variable substituition. Also please see this weblog on how to use FileName in variable substitution:

/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12

If you dont want to remove FileItem and LineItem then add these also in your content conversion. Then the parameters would be:

Recordset: TYPE,FileItem,FileName,DATA,LineItem,LineEntry

TYPE.fieldfixedlengths : 0

FileItem.fieldfixedlengths:0

FileName.fieldfixedlenghts:0

DATA.fieldfixedlenghts:0

LineItem.fieldfixedlengths : 0

LineEntry.fieldfixedlengths:301

LineEntry.endSeparator:'nl'

Regards,

---Satish

Former Member
0 Kudos

Satish,

Thank you for the information, I have tried with your suggestions, I got following error.

Could not process due to error: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Column value 'DD11022007' too long (>0 for 0. column) - must stop', probably configuration error in file adapter (XML parser error)'

Looks like we are configuring FileName.fieldfixedlenghts:0, but FileName length is >0.

PLease let me know if you have any other thoughts.

Thank you,

Balaji

Former Member
0 Kudos

Hey,

You want content conversion for sender or for receiver?

Regards,

---Satish

Former Member
0 Kudos

Satish,

I am looking for file content conversion on Receiver. The current situation is I want to write only part of XML payload. <u><b>I want to write following structure</b></u>

<DATA>

<LineItem> <LineEntry>234567891234567890123456789012345678901234567890</LineEntry>

</LineItem>

<LineItem>

<LineEntry>95473523647586969587265245437586979798376524253586</LineEntry>

</LineItem>

<DATA>

<u><b>I do not want to write content of</b></u>

<TYPE>

<FileItem>

<FileName>DD11022007</FileName>

</FileItem>

</TYPE>

Please look at original posting on how payload looks like.

Thank you,

Balaji

Former Member
0 Kudos

If you dont want to send content of TYPE field then dont map it to target. Your mapping program should contain mapping of only data part.

Data> LineItem>Line entry is complex structure.(You can check this in data type). I am not much sure that complex structure is possible with FCC or not.

Here consider Type as your first part and data is your second part. then you can add following FCC parameter.

Data.fieldNames

Data.fieldFixedLengths

Data.ProcessFieldNames

Data.LastFieldsOptional

Type.fieldNames

Type.fieldFixedLengths

Let me know the output.

-Gouri

Award points if useful.