Remove XML tags in the File Adapter
Hi,
I have a JDBC to File interface. However, there is a requirement to remove some of the XML tags from XML produced by the File Adapter.
For example,
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_XML xmlns:ns0="namespace">
<XMLIntegration>
<Prices COLUMNS="Index, Date, Price">
<Index>Fuel</Index>
<Date>2007-05-01 00:00:00.0</Date>
<Price>0</Price>
</Prices>
<Prices COLUMNS="Index, Date, Price"/>
</XMLIntegration>
</ns0:MT_XML>
needs to be changed to
<XMLIntegration>
<Prices COLUMNS="Index, Date, Price">
Fuel, 2007-05-01 00:00:00.0, 120.65
</Prices>
</XMLIntegration>
Does anyone know how to do this? I'm using the File Content Conversion Message Protocol but I'm not having much success
hi,
you just need to have this:
<XMLIntegration>
<Prices COLUMNS="Index, Date, Price">
Fuel, 2007-05-01 00:00:00.0, 120.65
</Prices>
</XMLIntegration>
as your target message in your mapping
and map all values to Prices tag
you don't need no content conversion - just the mapping
Regards,
michal
Similar Messages
-
Conversion of XML tags in receiver file adapter
Hi All,
I am sending one xml file to receiver file adapter.
But in case of receiver side I need to change the tags in XML structure,
eg:
if source aml file has tag <NAME> then in receiver case I need to convert it to <FNAME>.
How will I achieve it?Hi
I also have the similar query
The output message we get from XI has following format
<?xml version="1.0" encoding="UTF-8" ?>
<ns1:name xmlns:ns1="urn:xiworkshop:changetag">
</ns1:name>
I want an xml with following format
<?xml version="1.0" encoding="UTF-8" ?>
<name>
</name>
I need to write the file with with this structure and format using file adapter.
Can I do so in File adapter or mapping is required for the same?
Any suggestion would be highly appreciated(with points obviously )
Regards
Vanita thareja -
Multiple Return to Single Return is Removing XML Tag
Dear All,
I'm Using - InDesignCS3 + WinXP + VB6.
I've a InDesign file which is created by XML Import (Our Customers needs XML Output also at the End).
After importing i've done few modifications (Moved Figs & Captions to frames by PlaceXML method).
At this stage an Extra Paragraph Return (where the Figure placed while import, before moving to frame) is available.
When i tried to remove this by replace, XML Tag for the Figures are also deleted from the XML Structure of the Document.
Is there any other way to do this? - Please Suggest
Thanks in Advance,
SaRaVaNaN.N...Hai,
Here is a Simple Example for my Question.
Ex: Import the following XML and from the XML Structure (Ctrl+Alt+1) Move <figure> to a new Frame.
You'll see an extra paragraph return between those two paragraphs.
<root><para>...text 1...</para>
<figure><title>fig.1</title><img href="myFig1.jpg"/><caption>about the figure</caption></figure>
<para>...text 2...</para></root>
GoTo Story Editor (Ctrl+Y). You'll see as follows:
[x]para>...text 1...<para[x]
[x]figure]
[x]para>...text 2...<para[x]
After Replacing '^b^b' to '^b' it looks like below:
[x]para>...text 1...<para[x]
[x]para>...text 2...<para[x]
Figure Tag is removed from the XML Structure and Story Editor. Is there any way to remove this extra pragraph reture with keeping the XML Structure?
Thanks... -
Can I use a schema with no targetnamespace with the file adapter?
I am loading a file using a file adapter configured to use an xsd from a third party, the third party controls the xsd and incoming xml and does not have a targetnamespace defined in the xsd or xml.
When I define a file adapter for it the wizard indicates that I need to fix the xsd by adding a namespace. I dont have control over the xsd or xml as they are an external party.
I think I can hand edit the wsdl and change the import statement that requires a namespace to an include statement with no namespace.
Have you run into this before? Will that work?
Thanks,
JohnHi John,
Did we get any solution for this ?
Even in our case, the third party controls the xsd & incoming xml message. Both does not have a targetnamespace defined. The file adapter wizard indicates that we need to fix the xsd by adding a namespace. As a workaround, we manually added the target namespace to xsd and created file adapater. Now the question is how do we automatically add the name space in xml message as well, so that it can be parsed by BPEL process
thanks
Yj -
Not able to map contents of xml to output using file adapter
Hi
i m not able to map the output of file adapter to a variable when reading an xml. the data is coming in the file adapter output variable but it is not mapping to other variable in assign or transform activity.I m using jdeveloper 11.1.1.4.0.Can anbody help me plz.
Regards
Sourbhi am using file adapter as reference to synchronously read an xml file. i am able to see the flow trace in em console. the output variable of file adapter contains the data but when i m trying to assign the value to a variable i getting error. saying that some xpath is not returing any value.
i tried with transform activity also but same case is there. -
How to customize the File Adapter to put the header line in a variable?
I have a file in which the first line contains the number of records contained by the file itself.
Like this:
4
record1
record2
record3
record4
where each record is a delimited list of values
I need to validate that the records are actually 4.
in the documentation of the File Adapter I see that you can declare the first line as "header", but I have the impression that in this case it would be simply ignored, and not stored in a variable for later use......
Is this correct?
Any trick or workaround?
thank you soooo much!it worked like a charm,
here is the XSD I have used:
http://www.javamonamour.org/2010/12/soa-sutie-file-adapter-parsing-complex.html
( I don't seem to be able to display correctly XML in this post :o( ) -
Cannot process a Fixed Field Length file using the File Adapter (Sender)
Hi -
I have checked throughout these posts and blogs but I still have not been able to find a solution to my issue. When using the File Adapter (Sender) I get a Conversion initialization failed with "xml.keyfieldName", no value found. Why would I require a key field when I am using fixed field lenghts? The file is comprised of 2 structures - 1 header and multiple details (see below). There are no key fields in the flat file that I would be able to use. Any suggestions?
011000390 Customer Americas 20080605164317 000000000000000800000008000000000016000000
12345678 100500 100500 Supplier 1 0000000000030000002008040400
12345678 100501 100501 Supplier 2 0000000000052000002008042100
The File Adapter is configured as follows:
Document Name = Rfchke00
Document Namespace = 'my namespace'
Recordset Name = Rfchke00
Recordset Structure = Dtachkh,1,Dtachkp,*
Recordset Sequence = Ascending
Recordsets per Message = 1
Key Field Type = String (Case-Sensitive)
Dtachkh.fieldFixedLengths = 15,25,8,6,1,8,8,8,15,3,31
Dtachkh.fieldNames = F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11
Dtachkh.processFieldNames = fromConfiguration
Dtachkp,fieldFixedLengths = 18,13,13,35,15,3,8,2,21
Dtachkp,fieldNames = F1,F2,F3,F4,F5,F6,F7,F8,F9
Dtachkp,processFieldNames = fromConfiguration
Thanks,
DaveHi,
you can use the module from which u can convert your structure to
H011000390 Customer Americas 20080605164317 000000000000000800000008000000000016000000
D12345678 100500 100500 Supplier 1 0000000000030000002008040400
D12345678 100501 100501 Supplier 2 0000000000052000002008042100
Please note the extra H,D in the struture added by the module.
You can then use them as your key fieldValues.. The module should be deployed in Visual Admin and then can be used in the Module tab of your adapter CC
While writing the content conversion after that please dont forget about the added new characters
Please note also that i can find that the word supplier kept repeating in all the Dtachkp records
Please use that
Also if you feel that the field is of 13 characters and that would cause a problem dont worry... create a dummy field eg split tht 13 to two fields and use the common one as key field Value and identifier... as i see in ure case its like 500 Supplier , 502 Supplier . u can split the first 4 char and the remaing 9 char are key field value.
try this out
Rgds
Aditya -
"Performance" problems with the File adapter on Plain J2SE Adapter Engine
Hi,
At the moment I'm on a customer side to solve some XI issues for a few days. One of the issues is the performance of the Plain J2SE Adapter Engine, using the file adapter to transfer XML messages(already XI message format) from the legacy system to the Integration Engine. The File adapter has to deal with "large" XML messages(max at the moment is 65 Mb) and the engine fails with the following error when transferring the big XML file: "ERROR: Finished sending to Integration Engine with error "java.lang.OutOfMemoryError". Skip confirmation and quit this loop".
As far I got the information from the customer the memory use of the Plain adapter engine is set to 512Mb. This is maybe to low. But I don't know where to look for this, I only have the adapter web interface in front of me, no access to the OS it self via for example remote connection.
On the Integration Engine I know there is the ability to split large message with the file adapter(File Content Conversion), but I don't know this for the Plain Adapter Engine. Is there a possibility to do this also on the Plain Adapter Engine?
Thanks in advance for any input.
Greetings,
PatrickHi Sameer,
Thanks for your answers.
On the first solution, yes that is possible, we first decided to see if the legacy system can do the splitting, before starting developing a Java program.
On the second solution, as far as I know is this solution possible on the Integration Engine. But we are facing the problems on the Plain J2SE Adapter Engine. I went trough that documentation(link:
http://help.sap.com/saphelp_nw04/helpdata/en/6f/246b3de666930fe10000000a114084/frameset.htm ), to look for I similiar solution in the Plain Adapter Engine. So my question is, is this possible with the Plain Adapter? And if so, what kind of parameters I need to use to achieve this.
Regards,
Patrick -
Remove XML tags from XML element in Oracle
Hi,
I have a requirement where I have to remove all the xml tags from xml element with banks, currently I'm using replace 4 times to replace all different types of xml tags, performance is really bad. is there any better option to remove xml tags from xml data leaving the actual data. please find the example data below.
select
TO_CLOB(REPLACE(REPLACE(REPLACE(REPLACE
('<Concatcolumn><ConcatGroupID>MyText Data goes here </ConcatGroupID><ConcatGroupID>Data agian</ConcatGroupID></Concatcolumn>','<ConcatGroupID>'),'<Concatcolumn>'),'</ConcatGroupID>',';'),';</Concatcolumn>')) AS Concatcolumn
from dual
**************Out put*************
MyText Data goes here ;Data agianOne way is to use xquery:
SQL> with t as
select xmltype('<Concatcolumn>
<ConcatGroupID>MyText Data goes here </ConcatGroupID><ConcatGroupID>Data agian</ConcatGroupID></Concatcolumn>'
) xml from dual
select xmlquery('string-join(//text(), ";")' passing xml returning content).getclobval() xml from t
XML
MyText Data goes here ;Data agian
1 row selected. -
Passing file name dynamically to the file adapter
Hi All,
I'm using a file adapter to create a file from the XML message after mapping in XI. The file name is given in the file adapter configuration. Is it possible to have the file name as a part of the message and pass it to the file adapter dynamically? Or is it possible to have the file name in some variable or something in XI (like a BPM variable) and pass it to the adapter for every message?
Does someone have any idea?
Thanks,
SandeepHi Sandeep,
This is possible.
For creating filenames dynamically for your sender, you will have to crate a variable name ( eg: %VAR%) as you file name and then you will have to give the name of your file under variable substitution. Just check this link for more info,
http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
In the case of receiver file adapaters, you have 5 options for file creation like,
1.Create
2.Append
3. Add time stamp
4.Add Counter
5. Add Message ID
You can choose any of these options or you can do it dynamically from you payload. Just check out this help link for more info,
http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
Hope this helps -
Can I control filenaming when archiving files using the file adapter?
Hi folks,
Is there anyway to control the filename used when the File Adapter writes out to an archive?
Second question, I also need to be able to pass a "filename" to the adapter from an "input file." Is there a way to do this in the file adapter?
Sincerely,
lpacHi,
I have done that with the ftp adapter. In the .xsl file I wrote the following after the <xsl:stylesheet version="1.0" ....> tag:
<xsl:variable name="INFILENAME" select="ehdr:getRequestHeader('/fhdr:InboundFTPHeaderType/fhdr:fileName','fhdr=http://xmlns.oracle.com/pcbpel/adapter/ftp/;')"/>
<xsl:template match="/">
<xsl:variable name="OUTFILENAME"
select="ehdr:setOutboundHeader('/fhdr:OutboundFileHeaderType/fhdr:fileName', $INFILENAME, 'fhdr=http://xmlns.oracle.com/pcbpel/adapter/file/;')"/>
<opaque:opaqueElement>
<xsl:value-of select="/opaque:opaqueElement"/>
</opaque:opaqueElement>
</xsl:template>
</xsl:stylesheet>
To use this with the file adapter, you would have to wirte file where is written ftp.
Hope this helps,
Zaloa -
Unzip the file archived by the File adapter
Hi Experts,
we have a scenario where we are archiving a xml file using the File adapter and also it is being zipped by the OS command.
the script not only zips the file, it also rename the file from *.zip to *.xml.
Hence after archiving when I am trying to open it, the content appears to be junk.
Please suggest how to unzip the file as it got a extension *.xml.
And I also tried renaming the file to *.zip and then to uncompress, but it shows below error
Cannot open : it does not appear to be a valid archive
Thanks in advance,
MKhi Mk,
instead of using OS command try using the exesting module provided by the SAP, so your job will be easy.
follow this steps in the module processing for UN ZIP
Processing sequence:
Module name: AF_Modules/PayloadZipBean
Type: Local Enterprise Bean
Module key: 3
u2022 Module configuration:
Module key: 3
Parameter name: zip.mode
Parameter value: unzip.
in the commincation channel specify filename.xml
so you can open the file in XML format
Thanks,
Madhav
Note:points if useful
Edited by: madhav poosarla on Aug 14, 2008 8:31 AM -
Problem regarding Configuring the File Adapter
Hi,
I am making a Flat File to XML File Scenario. I have made all the Necessary developments and the Routings in the Integration Repository and the Integration Directory. The Sender Communication Channel Uses the Message Protocol "File Content Conversion". All the required steps have been done. We have installed the System and also the Basis Team has done the Post Installation Activities.
<b> The Problem is that the "File is not getting picked up". When checking the RWB and henceforth the Adapter Monitoring we see that the File Adapter is disabled and the XI and the BC adapters are green. Previously we were on SP9 and now we are on SP14. The SAP Basis is at 640 and SP9 and the SAP ABAB is on 640 and SP9.</b>
We are also unavailable to see the File Communication Channels that we have created. When the Tcode "sxi_cache is run it is giving an error that Cache not refreshed andon refreshing various times too the Cache is not Refreshed.
Please Suggest us what we should do. Eagerly waiting for a reply and Thanking in Anticipation. Do we need to make some for configurations for that.
Warm Regards
Chakra and SomnathHi Somnath,
If the sender file adapter is up and running and even after that if you find some problem, the first thing you need to do is check if your file has been picked. The easiest way to check the same is to set the mode to DELETE, that is the file gets deleted as soon as it is picked. If your file has not been picked then the reasons for the same could be the following.
- The path that you specified while configuring the sender communication channel would have been wrong.
- While specifying the file name take care as it is case sensitive.
- If you require content conversion then make sure that the parameters entered at the time of configuration are all correct.
Please go thru the following links to get a very clear picture of your requirement.
http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/44/6c9442c22d1131e10000000a1550b0/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/8c/607fe4756b654ab9f420097c29f6e9/frameset.htm
Also make sure that your content conversion is in sequence wrt Datat Type Sturcture.
Go through these blogs below for more detail on the same:
/people/sap.user72/blog/2005/01/06/how-to-process-csv-data-with-xi-file-adapter
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
I hope this would help you solve your problem.
Regards,
abhy
Message was edited by: Abhy Thomas -
PI needs to obtain a zip file via FTP using the File adapter
I have a scenario where PI needs to obtain a zip file via FTP using the File adapter, this zip file contains a number of txt files that I need to process, and the content of one of them send it to an ECC, now I'm using the PayloadZipBean Module in the Sender FIle Adapter, and I have two things if I use the Message Protocol as File, I get a Payload for each txt file in the zip file, but this payload has no structure, and if I use the File Content Conversion I get an XML strcuture with only one field and a strange string in it, and somewhere in this string the names of the files I assume all the content of the zip file, can anyone help on how could I achieve what I need that is to pull the zip file via SAP PI, then unzip it, and with the content of one of the txt files send it to an ECC via ABAP Proxy, thanks in advance for your answers.
Regards,
Raul AlvaradoHello Raul,
you can do it in futher way ...
pickup zip file and simply extract and dump it in another temp folder (can use scripts on OS level).
@ then Use another sender communication channel to pickup all these text file .
for further clarification you can use these links also. -
Process txt files in zip file
Accessing File using FTP from Java Mapping
File Sender Adapter with FTP protocol
BR
Raj -
Get the name of the file generated by the File Adapter
Hello,
I am creating XML files using the File Adapter. Each file name is unique (my_file%SEQ%.xml) and I would like to know if there is a way to get the name of the generated file so that I can sent it as an attachment in an email notification. Thanks!you can't get the generated filename for write operation.
But what you can do, is to define header variable of OutboundHeader_msg type, define your own filename (based on your unique creation criteria) and then pass it to invoke activity for file creation.
Maybe you are looking for
-
Some problems with my imac + after effects
Hi everybody! Fisrst of all, sorry for my english, i've just started to study seriously... My problem is: I have an iMac with a few years on its back. Here the specs: - iMac - Intel Core 2 Duo - 2,8 GHz - 1 (Processor) - Cor
-
Aperture 3 - How to move the title on a blank slide
Hi again, As explained in my previous post, I have downloaded the trial version of Aperture 3. Apart from my export pb with the sound, I have another problem. I have inserted a blank slide at the beginning of the slideshow. There is a title at the bo
-
MacBook won't go to sleep automatically
Just recently, I've noticed that my MacBook won't go to sleep. It was fine for the last year. If I go to the Apple Menu and tell it to sleep, it will. But, it doesn't sleep in the prescribed amount of time set in the control panels. Does anyone know
-
How to generate CSR on switches for web auth with NGS
Hello I am doing a dot1x solution with web auth on cisco 3750 switches. Once the wired client get put into web auth state (after dot1x and mab) and goes to a website, he gets a certificate warning. This is because the certificate of the cisco switch
-
don't know what else you need to know. running firefox 7.0.1 OS 10.6.8 worked fine earlier this morning. just started happening. no work around.