Adding Header elements in File Adapter
Proxy to File (CSV)
I donot have a header in my target structure.
I want these elements in Header
ResourceID FirstName LastName Email
Values should be under them correspondingly.
I have used the foloowing for testing it is not working
1)
Records.addHeaderLine 1
Records.addHeaderLineElements ResourceID,FirstName,LastName,Email
Records.headerLineElementsSeparator ,
Records.headerLineElementsEndSeperator 'nl'
Line.fieldNames TotalRecords,Insertedrec,FailedRec
Line.fieldSeparator ,
Line.endSeprator 'nl'
Records.addHeaderLine 1
Records.headerLine ResourceId FirstName LastName Email
Records.fieldNames ResourceId,FirstName,LastName,Email
Records.fieldSeperator ,
Records.endSeperator 'nl'
You can have addHeaderLine for only one structure.
This specification is only permitted if exactly one structure is defined.
There are two structures in your configuration: Line,Records
You can add third structure in your target structure say header and map constant values in mapping.
Thanks,
Beena.
Similar Messages
-
Adding Header Elements in Jdev 11g
Hi ll,
Using Jdev 11g and created a SOA application. My input xml has 5 header elements (versionNo, ServiceName etc), that I want to ultimately pass to the webservice I am invoking.
Question: How do I create a XSD which will include these 5 Header elemnts ?
OR is there a way in Jdev 11g soa editor to provide these required Header elements as part of my request ? If yes, then what are the steps in jdev, which wizard do i use to include these header elements ?
thx
ppTry asking this on the SOA Suite forum.
-
Adding Namespace in Sender File Adapter Scenario.
Hi All
I have a scenario where XI has to Pick Up XML a file and process it. The structure of the file is as follows
<?xml version="1.0" encoding="UTF-8" ?>
<Header>
<Seg1>
</Seg1>
</Header>
This file does not contain any any namespace tag. I guess XI would not be able to pick up this file if there is no namespace in the XML file . The file expected by XI would be something like this.
<?xml version="1.0" encoding="UTF-8" ?>
<ns0:MessageTypeName xmlns:ns0="...namespace...">
<Header>
<Seg1>
</Seg1>
</Header>
</ns0:MessageTypeName>
Is there a way this can be handled at the File Sender adapter side . I am aware about adding adapter module. Is there any other way to add the missing two namespace tags at the top and bottom of the file .
any help would be appreciated.
regards
Nilesh .
Edited by: Nilesh Taunk on Apr 7, 2008 2:11 PMHi Nilesh,
Yes it is possible in File sender adapter to give the namespace. In FCC you can give inside Document Specification.
Under Document Name, enter the name of the XML document.
The document name is inserted in the message as the main XML tag. This is mandatory for the mapping.
Under Document Namespace, enter the namespace of the document.
The namespace is added to the name of the document. This is mandatory for the mapping
I hope this will help you.
Regards
Aashish Sinha -
File Adapter - Schema Reference Issue
Hi Experts,
I am working on project in SOA Suite 11.1.1.6
The project has a File Adapter which writes the files to a particular destination.
Following is the WSDL of WRITE File Adapter :
<wsdl:definitions name="QCCCEQFileWriteOutbound"
targetNamespace="XXXXXXXXX"
xmlns:tns="XXXXXXXXX"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:opaque="http://xmlns.oracle.com/pcbpel/adapter/opaque/"
xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
<plt:partnerLinkType name="Write_plt">
<plt:role name="Write_role">
<plt:portType name="tns:Write_ptt"/>
</plt:role>
</plt:partnerLinkType>
<wsdl:types>
<schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/opaque/"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="opaqueElement" type="base64Binary"/>
</schema>
</wsdl:types>
<wsdl:message name="Write_msg">
<wsdl:part name="opaque" element="opaque:opaqueElement"/>
</wsdl:message>
<wsdl:portType name="Write_ptt">
<wsdl:operation name="Write">
<wsdl:input message="tns:Write_msg"/>
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>
When the process is running on TST server, if DEV server is DOWN its throwing this error:
<bindingFault>
<part name="summary">
<summary>Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'Write' failed due to: Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "Could not instantiate InteractionSpec oracle.tip.adapter.file.outbound.FileInteractionSpec due to: XSD Resolution problem. XSD Resolution problem. Unable to load Translation schemas from for http://xmlns.oracle.com/pcbpel/adapter/opaque/ due to: Unable to lookup schema for 'http://xmlns.oracle.com/pcbpel/adapter/opaque/' Please make sure all used XML schemas are imported/included correctly. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary>
</part>
<part name="detail">
<detail>Tried all: '1' addresses, but could not connect over HTTP to server: 'XXXdev.XXXXXXXX.com', port: '80'</detail>
</part>
<part name="code">
<code>null</code>
</part>
</bindingFault>
Why is Test File Adapter WSDL is trying to connect DEV Server. I haven't added anything specific is File Adapter WSDL its the default generated WSDL of File Adapter. I am also not using MDS in project
Please help me in this regards. Thanks in Advance.Hi Mathieu, Vijay,
Here is the import and reference of File Write Adapter which is failing from composite.xml. It doesn't have any DEV references as its an Adapter pointing to JCA file.
<import namespace="http://xmlns.oracle.com/pcbpel/adapter/file/XXX/XXXXProcess/XXXFileWriteOutbound"
location="XXXFileWriteOutbound.wsdl" importType="wsdl"/>
<reference name="XXXFileWriteOutbound"
ui:wsdlLocation="XXXFileWriteOutbound.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/pcbpel/adapter/file/XXX/XXXProcess/XXXFileWriteOutbound#wsdl.interface(Write_ptt)"/>
<binding.jca config="XXXFileWriteOutbound_file.jca"/>
</reference>
There are other references which are pointing to DEV, which I replacing with deployment plan. This service is failing at the Adapter call with the message i mentioned in initial post.
I checked the WSDL Binding in System Mbean Browser - the values are properly replaced with TST URIs.
Please share your thoughts, thanks again for your response. -
How to create SOAP Header elements using SAAJ??
I am facing a problem when adding header elements under SOAP Header
using SAAJ(api).
I want to create a structure as following:
I get a empty SOAP header obejct by writing code--> SOAPHeader header
= envelope.getHeader();
But not able to add SOAP header elements as specified in example
below. I tried but its giving me error as
"HeaderElements must be namespace qualified"
CAN ANYBODY TELL ME THAT HOW TO ADD HEADER ELEMENTS USING SAAJ??
<SOAP:Header>
<AccountNumber>123</AccountNumber>
<AuthorisationCode>test111</AuthorisationCode>
<Source>abc</Source>
<Market>01</Market>
</SOAP:Header>I'm including this comment from some code I've just written after wrestling with this for hours (I've actually left it on another post as well). The upshot of it all is that you have to include a namespace URI when creating a header in SAAJ:
NOTE: SOAP 1.1 requires that all header entries be namespace-qualified to
namespace URI's. The SAAJ 1.2 implementation requires a Name object with
the namespace URI to make this happen even if the prefix used is already
visible by being declared higher in the document (e.g. in the Envelope).
However, the namespace URI is not present in the serialized header element
as long as it was declared higher in the document. In order to create a
header element without a prefix (to conform to a web service definition
that doesn't use a prefix in its headers, for example), leave the prefix
null in the addHeaderElement() method.
For example, with a SOAPHeader 'hdr':
//first create the name
Name name = env.createName("my-local-name", null, "my-URI");
//then create the header element
SOAPHeaderElement he = hdr.addHeaderElement(name);
This would result in an XML element that looked like this:
<my-local-name xmlns="my-URI"/>
This would allow SAAJ developers to create a header for a service that
only expected a local name in its header elements (as many do!). As long
as the service doesn't choke on the attribute (validation! evil!), this
should work.
Rob Kemmer
01/12/2005
-
Extra Blank Line gets added at the Beginning of the file by File Adapter...
Hello All,
I have created an RFC to File Adapter scenario in PI 7,1 and I am using Content Conversion in the File Adapter to convert the payload structure to flat text file. The input Structure is simple as follows:
<File>
<FName>some file name</Fname>
<Record>
<Data>
<Line>Text Lines</Line>
</Date>
</Record>
</File>
while using the following Content Conversion Parameters: While I have defined "Record" as Structure.
Record.addHeaderLine = 0
Record.fieldSeparator = 'nl'
Record.endSeparator = 'nl'
Here everything is working fine except that the text file getting generated has a blank line at the beginning. I was thinking that by adding "Record.addHeaderLine = 0" parameter, no header line will be added to the file but this seems to be not working. I tried to include the top element "File" with the same parameters and different combinations but was not able to achieve the result and it stopped the file creation altogether.
So, I'll appreciate if anyone can suggest something to get rid of the this blank line at the beginning of the file.
Regards,
AtharExtra blank line is actually provided for the FNAME node, but not displayed because of it has different structure with Record node.
Change the structure for FNAME to :
<FName>
<Data>
<Line>some file name</Line>
</Data
</Fname>
this way "some file name" will be dispalyed in the text file at the first line of file. To remove it use this trick, define the following values in Content Conversion Parameters:
in the Recordset Structure : FName,Record
FName.fieldFixedLengths = 0
FName.fixedLengthTooShortHandling = Cut
FNamee.fieldSeparator = '0'
FName.endSeparator = '0'
Record.fieldSeparator = 'nl'
Record.endSeparator = 'nl'
Rgds,
Triana -
File-adapter with Dynamic Directory/Filenames in Header-variables
Hi,
I have looked through the file-adapter documentation. And it says that you can use wildcards/regexpressions/dynamic file and directory names using the file-adapter-wizard. Also you can use the header-variables to specify the file and directory names at run-time.
Is it also possible to use the dynamic names using the header-variables?
I want to create a process that I can give in the file/directory-names at run-time and that it will look for a file using the wild-cards to pickup. Since at run-time I often do not know the name of the file, since it might contain a sequence or date/time-stamp. But I do know the location and the structure of the file name (that is specified at config-time).
The same question for outbound: if I specify a name in the header-variables with forexample '%seq%' in the name, like 'filename_%seq%.XML', will it then create the file with the sequence?
Thanks in advance.
Regards,
MartienHi,
I've been trhough this document over and over again, but did not find anything on how to do it actually. But I found out that the file-outbound-header wsdl does not contain a directory element after generation by the wizard. But you can add it afterwards.
Also you can replace the location attribute in the jca:address element of the adapter-wsdl by mcf properties (host, username, password) and override them by copying the values to the partnerlink using bpelx:properties.
I planned to put the details in my blog.
Regards,
Martien -
File Adapter - File Content Conversion to XML last element missing
I'm using the SAP File Adapter with File Content Conversion to convert | (pipe) delimited records into XML.
When the last field is blank, I would expect that an empty node gets created, however, the node doesn't get created at all.
For example given these settings...
Record.fieldSeparator = |
Record.endSeparator = 'nl'
Record.fieldNames = FIELD1,FIELD2,FIELD3
Using this three record file as my data...
|123|XYZ
ABC||XYZ
ABC|123|
When converted to XML, this is what the recordset XML structure looks like...
<Recordset>
<Record>
<FIELD1 />
<FIELD2>123</FIELD2>
<FIELD3>XYZ</FIELD3>
</Record>
<Record>
<FIELD1>ABC</FIELD1>
<FIELD2 />
<FIELD3>XYZ</FIELD3>
</Record>
<Record>
<FIELD1>ABC</FIELD1>
<FIELD2>123</FIELD2>
</Record>
</Recordset>
Notice that the last record is missing the "FIELD3" element.
Edited by: William Krick on Jun 17, 2011 4:49 PMGiuseppe Agnello wrote:
> Sorry, there was a typo in the parameter name.
> Word fields should start with capital F.
> Try with Record.missingLastFields, with value "add"
>
> http://help.sap.com/saphelp_nw70/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm
>
> Similar issue was resolved with same parameter in this thread:
> Sender file adapter with FCC not creating last field
That did the trick. It was a typo. Thanks Giuseppe.
I'm willing to bet that this parameter was added to fix the parsing bug without breaking existing users that had already worked around the original bug. You shouldn't really have to special case the last field. -
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( ) -
MQ to File: How to send a Filename from JMS Header (MQ) to a File Adapter
Hello Experts,
I have a flat file coming into PI via JMS adapter (MQ) and going out on a File adapter (NFS). We would like to keep the file name consistence throughout the transaction. While coming from MQ our sender is sending the filename in one of the MQ Headers (JMSCorrelationID). We are trying to figure out how to read the file name from the MQ header and send it to the file adapter. Please let us know any other suggestions.
Thanks,
MayurUse this UDF code in MessageMapping.
try
DynamicConfiguration conf = (DynamicConfiguration)
container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey KEY_JMSCorrID = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/JMS","DCJMSCorrelationID");
DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
conf.put(KEY_FILENAME, conf.get(KEY_JMSCorrID));
catch(Exception e){}
return a; //a is some input field.
Enable ASMA on receiver File channel.
Edited by: Praveen Gujjeti on Mar 17, 2010 9:23 AM -
Is a record ID field required for File Adapter (Header, Body, Trailer)?
Hi,
File to File scenario. The sender file is a text file i.e. .txt which needs a conversion on the sender file adapter. There are three structures in the file namely header (one), body (many) and Trailer (one). From what I can see I need a record Id field (with the same name) in all the structure types, can anyone confirm this for me?
Thanks,
LeanneThat is correct. If you have a variable number of records of a particular type, then you need a way to accurately identify each type of record... and that is done via the key field (or Record ID) which is present in each record type.
Extract from SAP Online Help:
<i>Key Field Name
If you specified a variable number of substructures for Recordset Structure, in other words, at least one substructure has the value *, then the substructures must be identified by the parser from their content. A key field must be set with different constants for the substructures. In this case, you must specify a key field, and the field name must occur in all substructures.
Specify the Key Field Type to be used to compare the predefined values. This entry is used if the key field name is defined.
NameA.keyFieldValue: Specify the value of the key field for the structure. This entry is mandatory if the key field name is set. Otherwise, the entry is ignored.</i>
For more info, refer to the SAP Help:
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm -
Multiple Header line in Receiver File adapter
Hi,
I have an issue in Receiver File adapter with multiple header lines. I am able to get only 1 header lines in the receiver file but not multiple header lines with 'nl' since it is static in file mode
[CommunityTag:Header]
empNo,EmpName,Age
[CommunityTag]
I tried with the below in content conversion one as below with no luck
Root.addHeaderLine=1
Root.headerLine=[CommunityTag:Header] 'nl' empNo,EmpName,Age 'nl' [CommunityTag]
Root.fiedSeparator=,
Root.endSeparator='nl'
I am getting the Header line as same row as static text.
Can you advise this.Hi Gabriel, I suggest to produce the header lines from additional nodes in the message payload. That means you need to modify the data type of the target message in order to generate an extra structure in the payload. Use constants in message mapping to generate the header column names, e.g.
<Header>
<H1>CommunityTag:Header</H1>
<H2>empNo,EmpName,Age</H2>
<H3>CommunityTag</H3>
</Header>
In content conversion you have to convert the Header row with
Header.endSeparator='nl'
You won't need parameter addHeaderLine anymore then.
Regards, Martin -
File adapter don't want to ignore the header row in file
Hi gurus!
In my sender communication channel I specified Document Offset = 1 to spent the first row in file(header)
But it doesn't work.
Do you have any ideas?Under Document Offset, specify the number of lines that are to be ignored at the beginning of the document.
This enables you to skip comment lines or column names during processing. If you do not make an entry, the default value is zero lines.
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm
But in Receiver File adapter
NameA.addHeaderLine=0
is used to have no Header line in the target structure
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm -
File adapter - change of encoding in the header of the xml message
Hello!
I would like to change the encoding in the header of an xml message (sent to a a receiver file adapter)
from <?xml version="1.0" encoding="UTF-8" ?>
to <?xml version="1.0" encoding="ISO-8859-1" ?>
We have XI 3.0 with SP15.
Can anybody help me please?
Kind regards
ChrisHi Chris,
An XSLT map can convert the encoding for you.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method='xml' encoding="ISO-8859-1"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Thanks,
-Russ -
File Adapter Wizard - Native Format Builder - no spaces in header?
My project uses a vendor supplied, delimited text file. The first row of the file is a header, followed by data rows. The problem is that the header elements contain spaces, Which are not acceptable by the Native Format Builder.
Has anyone experienced this before and know of a good work-around? Or, is this a known issue?You can make use of the attribute "headerLines" in the top level "schema" tag. It would look something like this nxsd:headerLines="1".
This will skip first header line and will start from line number 2.
More Info here : http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/nfb.htm#CHDBECJI
Hope it helps.
Maybe you are looking for
-
Memory limitation for session object!
what is the memory limitation for using session objects? venu
-
I Phone 4 - problem with bluetooth after upgrading to ios 4.2.1
Since I have upgraded the software on my I phone 4, I have noticed a problem with my hands free kit in my car using bluetooth. When I make a call the sound comes through the system ok, but if I dial to voicemail the sound doesn't come through. I neve
-
Can a MacBook pro be linked with an LG SmartTV?
I have just bought an LG Smart TV -- 55LA7400 -- which uses the same wireless network as my MacBook Pro (retina). I would like to link the computer to the TV without mirroring thru Apple TV (thus freeing the Apple TV for another, not-smart TV). Ca
-
Speakerphone doesn't work post iOS7 upgrade.
Speakerphone doesn't work, I can't hear anyone when I put them on speakerphone or when i try to listen to voicemail on speakerphone. This happened post iOS7 upgrade. Any idea?
-
How to find concurrent Request ID?
Hi, One seeded concurrent program ('Pay on receipt Autoinvoice Program') internally submit the one more seeded concurrent program('Payable Open Interface').Now my requirmnet is finding request id of 'Payable open Interface' . Is it possible? If Yes,P