on 02-09-2015 4:14 PM
Hi experts,
I have to build an empty file to proxy scenario.
in my CC Sender File I use 'File Content Conversion' as message protocol. But my inbound file is empty, so I have an error in sxi_monitor :
Problem while determining receivers using interface mapping: Error while determining root tag of XML: BOM / charset detection failed
I want change my CC SenderFile and use 'File' as message protocole, but i don't how define receiver determination without interface determination.
Is it possible ?
Thanks
I'm a little late to this conversation but here are my thoughts. But before that, it would be useful if you specify your PI version and whether it is on single stack or dual in your queries - it affects the solution that others offer.
Note that you will need ESR objects for this, so here it goes (take particular note those items highlighted in red):-
i) Define source data type (for sender file) with single dummy field occurrence 0-1
ii) Define target data type (for receiver proxy) with single dummy field occurrence 1-1
iii) Create all the necessary Message Type, Service interface for sender and receiver
iv) Create message mapping - Map a constant of any value to the target dummy field
v) Create operation mapping
vi) Configure all the necessary objects in Integration Directory (either classical scenario or ICO/iFlow)
- Make sure for your sender agreement, receiver determination that you do not specify the SWCV for the sender interface (this is to prevent it from performing XML parsing on the empty file)
viii) For your sender File comm channel, make sure Empty File Handling = Process Empty File
That is it. The source system can give you an empty file and you don't need a UDF to write the filename.
I have something like this that works, but on a slightly different scenario - on the response portion of an outbound sync interface, the response payload is empty but I have to return a status field to the calling proxy. So I just created a mapping with a constant mapped to the status field.
Rgds
Eng Swee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Yes that's what i've done.
It's OK when my communication sender file uses NFS protocol.
But when my communication sender file uses FTP protocol, I have this error in the monitor :
Error when determining the receiver: Problem while determining receivers using interface mapping: Error while determining root tag of XML: BOM / charset detection failed
my CC sender file is defined like this :
Any ideas ? What if I change the file type (ASCII or UTF...)
Hi,
I have tested this solution.
Problem is my inbound file is empty, so proxy doesn't accept empty XML.
I can't change inbound file, it come's from an external service.
How can I call proxy with a value (constant or anything else) with an empty inbound file ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Guz,
Your inputFile.txt is always in empty.
Solution 1:- Sender file channel will pick inputFile.txt and additional attachment file myPayload.txt. Create a myPayload.txt (it will have XML required to call the proxy) and place input folder. Use payload swap bean in sender channel to swap to myPayload.txt.
No mapping is required.
Challenge is to create the myPayload.txt every time. I am still thinking about this.
FYI.
Specifying Additional Files in the Sender File Adapter - Advanced Adapter Engine - SAP Library
Solution 2:-
If you can request source system to send at least one character in inputFile.txt. Because, empty file will not execute any mapping.
Then implement below Java mapping. More info, ESR object, Java mapping.
package com.map;
import java.io.*;
import com.sap.aii.mapping.api.*;
public class Test_JavaMapping extends AbstractTransformation {
public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput) throws StreamTransformationException {
try {
OutputStream outputstream = transformationOutput.getOutputPayload().getOutputStream();
//Write a XML required by proxy to output. Change below XML to required XML. We are ignoring input.
outputstream.write("<?xml version='1.0' encoding='UTF-8'?><note><to>ABCD</to></note>".getBytes());
} catch (Exception exception) {
getTrace().addDebugMessage(exception.getMessage());
throw new StreamTransformationException(exception.toString());
}
}
}
Guz,
I understand, you want to develop a pass-through asynchronous file-to-proxy scenario. Input file is always empty, it will just trigger the interface (to call the proxy).
Solution:- ESR objects are optional. If you want to create receiver service interface for proxy in ESR, you can create it. No mapping is required.
Configure ID objects. Use ICO or Sender agreement (with dummy sender service interface), Receiver determination, Interface determination (no mapping) and Receiver agreement.
I am not clear on, how proxy will be called with empty XML. I would suggest using a fixed XML input file, which will trigger the proxy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes it is possible..using Classic XI scenario..Just have a dummy field in the source message structure. Map parent nodes of Source XML to Target XML..or use ICO without any ESR content
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guz,
This exception is generated because at mapping level the message can't be interpreted like XML and the PI thinks that is binary but the charset is pointing that it must be an XML.
You can try with:
- Select the option Skip Empty Files under Handling of Empty Files
- If the message is not really empty but it is a big file, then probabbly the is not written when the PI polls and pick it. The you can use Msecs to Wait Before Modification Check under Define Additional Parameters
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guz,
Why are you using FCC is you have always an empty file?, move the file without ESR development: SAPTechnical.COM - File-to-File Scenario without creating Repository Objects
Regards.
Hi Guz,
I haven't tried it but from my point of view the inbound proxy needs a real service interface and to do a file to proxy scenario seems to be impossible, at least for my understanding.
You can do a file to file without ESR and a report in the ECC endpoint that polls the file system in a job.
Try first Sriram Ramani suggestion and reply in the forum with the result, it is always possible to learn something new
Regards.
Message was edited by: Iñaki Vila
Hi Guz,
You need to select the option to Create message for Empty file under Processign tab. Once this is done a file will be generate and you need to adjust it in your mapping by mapping the parent node appropriately.
Regards,
Sriram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you transforming the file between the sender and receiver adapters? If not then you don't need to use file content conversion, this will solve your problem.
Do you need to transform the file AND handle an empty files?
Che
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.