on 12-05-2008 1:43 PM
Hi,
I am creating a FIile to SOAP scenario.
I have to send the file that is picked up through the SOAP adapter to a 3rd party system.
I understand that SOAP adapter can only send the file as a attachment.
My Requirement
I want to read the file using the FILE adapter. The file i am going to read is a .pdf
After the file is read i want to convert the file to a attachment.
Please help me, how to go about in making the file picked up as a attachemt.
Thanks,
Vignesh
Hi vignesh
This is quite confusing
How you want it to happen. Soap adapter picking file ? or file adapter?
In File to SOAP case
I assume File adapter picks the file. Now when you pick a file as an attachment then you cannot access that attached file in mapping. This will go as attachment to SOAP and use Keep attachments in SOAP.
To read the file adapter attachments use Additional file option in file adapter. You need to keep the same file name as file in File Name field. and mock the extension as well
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gaurav,
I am doing a File to SOAP scenario only.
I do not want any mapping to be carried out on the file.
If the name of the file i should pick up is xi_input.pdf
I have to use the same file name in the "Additional files" option?
Wil this make the xi_input.pdf as a attachment ?
If this is possible, i dont need to use Payloadswap bean in the SOAP receiver adapter rgiht ?
HI Vignesh
If you dont have to do anything in mapping then no problem. You can read this file as attachment and send as an attachment through SOAP.
Read this file as additional file
if the name of PDF is xi_input.pdf. Just keep a dummy xml file xi_input.xml to trigger this process and additional file to be picked.
if you can have more than one file coming in this location its good to use processing sequence by name and type binary
file list <xi_input.pdf>
set parameters
<xi_input.pdf>.namePart -> ".pdf"=".xml"
<xi_input.pdf>.optional -> YES
<xi_input.pdf>.type -> BIN
You don't need to use PayloadSwapBean for this requirement
I think it can be done without IR objects as well. Only ID is sufficient for this. Give it a try !!
Thanks
Gaurav
Edited by: Gaurav Bhargava on Dec 6, 2008 11:59 AM
Vignesh
Best Idea would be create an Attachment to the XI message using Adapter Module and Later use the Payload SwapBean to send it to SOAP Adapter as attachment with standard XML message.
Use the Following Code to add an Attachment in the Adapter Module :
try {
// get the XI message from the environment
Message msg = (Message)
inputModuleData.getPrincipalData();
// create a new payload
TextPayload attachment = msg.createTextPayload();
// provide attributes and content for the new payload
attachment.setName("Attachment");
attachment.setContentType("text/plain");
attachment.setText("Hello World");
// add the new payload as attachment to the message
msg.addAttachment(attachment);
// provide the XI message for returning
inputModuleData.setPrincipalData(msg);
} catch (Exception e) {
// raise exception, when an error occurred
ModuleException me = new ModuleException(e);
throw me;
regards
Ganga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.