I dont want to insert the header part to database, only values should be inserted.Im using a insert adapter service. Please reply. Im very new to web methods
When reading the records from the flat file, skip the first record. You’ll need to do that yourself as (oddly) the flat file services do not provide a flag for us to indicate we want the first record skipped.
To know if something is amiss with the adapter service or the caller, we’d need to see details of both.
The character encoding of the file is probably the reason you’re seeing spaces and non-printable characters. What encoding is used by the file and which encoding is specified in the convertToValues or bytesToString call? The default encoding of the JVM is UTF-8. If the file is not UTF-8 encoded or the JVM default encoding has been changed, then the conversion of the bytes to string will not function properly.
You’ll need to skip the first record in your code. If you set flags/addRecordCount to true in the convertToValues call each record will have a @record-count attribute that you can check. The count starts at 1, so branch on that and skip.
If you are using the flat file adapter and parse the data using a flat file schema you may as well define a hierarchic structure with one header rcord (identified by any of the header fields as I assume those are fix) and default records (recordWithNoId) as childs. You can then map only the child records to your targ (or interim) structure.
I prefer this solution for my own integrations because this way the structure of the file and the omitted record are clearly visible in the schema describing the file.