Encoding tag in file/receiver

Hi all,
I need to send an XML encoded with ISO-8859-1. I have found the field <i>file encoding</i> in the receiver comm.ch. and wrote <i>ISO-8859-1</i> (exactly this).
The XML output seems to be ok, but... the encoding tag in the header remains <?xml version="1.0" encoding="UTF-8"?>.
I need to change it from UTF-8 to ISO-8859-1.
What else am I missing?
thnks,
David R.

Hi David,
have a look at question 16 from SAP note: 821267
I don't think it's possible with XML files
to change it with the encoding parameter
from the note:
"Even if you configure a File Encoding in the File Adapter channel, the File Adapter will not re-write the XML header to reflect the changed encoding"
Regards,
michal

Similar Messages

  • Namespace tag change in receiver file adapter

    Hi Group,
    My requirement: Need to change the Namespace tag at the receiver side.
    My XML will be something like below:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:ASNList xmlns:ns0="http://www.apriso.com/SXI.GLS">
       <EventData>
          <SenderName>Test</SenderName>
          <ReceiverName>Test</ReceiverName>
          <TimeUTC>10:00:00 IST</TimeUTC>
       </EventData>
       <AdvancedShipmentNotification>
          <ID>ASN</ID>
       </AdvancedShipmentNotification>
    </ns0:ASNList>
    I need to transform the message like below;
    <?xml version="1.0" encoding="UTF-8"?>
    <n1:ASNList xsi:schemaLocation="http://www.apriso.com/PMI.GLS SXI.GLS.ASN.xsd" xmlns:n1="http://www.apriso.com/SXI.GLS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <EventData>
    <SenderName>LES</SenderName>
    <ReceiverName>OSS</ReceiverName>
    <EventTimeUTC>2001-12-17T09:30:47.0Z</EventTimeUTC>
    </EventData>-
    <AdvancedShipmentNotification>
    <ID>ASN</ID>
    </AdvancedShipmentNotification>
    </n1:ASNList>
    I have tried to achieve by writing a UDF, all seems to be fine but the "XML is not well-formed". Below is my UDF code:
    public String setNSDeclarations(String a,String b,String c,Container container){
    StructureNode node = ((StructureNode) container.getParameter("STRUCTURE_NODE"));
    node.setNSDeclarations(" xmlns:" + c + "=" + b);
    node.setQName(a + "ASNLIST");
    return "";
    Please suggest if there is any other way to achieve this requirement.
    Regards,

    Hi Hanumantha,
    XMLAnonymizerBean should work for your requirement, please refer the below blog
    Remove namespace prefix or change XML encoding with the XMLAnonymizerBean
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/07/10/handling-namespaces-in-pi-using-xmlanonymizerbean
    http://scn.sap.com/people/gabrielsagayaselvam.panneerselvam/blog/2009/12/07/standard-adapter-framework-modules-afmodules-in-pi-71-part-1
    regards,
    Harish

  • When I try to open an .ai/pdf file received through my email, it won't open and asks for a password. I have never set up any kind of password for email security, but have tried typing in my standard passwords. Nothing works. I wonder if it has anything to

    When I try to open an .ai/pdf file received through my email, it won't open and asks for a password. I have never set up any kind of password for email security, but have tried typing in my standard passwords. Nothing works. I wonder if it has anything to do with the use of my Wacom3 Tablet...I've been having trouble with it and was getting the same message when trying to open the User's Manual in my Applications/WacomTablet file on my hard drive. Any suggestions? I just downloaded the latest version for the Wacom and recently upgraded to Snow Leopard 10.6.7 (which I hate, and my CS3 hates, etc.)

    It sounds like you have a a password-protected PDF. The password was set by the person who encoded it.

  • Problem with Append mode in File Receiver

    Hello,
    I am facing some problem with Append Mode in File Receiver.
    In channel config, i have given :
    Construction Mode : Append
    File Type : Text
    Message Protocol : File Content Conversion
    The size of the file which i am trying to send is about 9.5MB.
    I got this error,
    "Recovering from loss of connection to database; message
    loaded into queue by recover job: System Job (Failover Recovery)".
    So, it would seem that there was a loss of connnection to the database    
    while the file was being written.
    Note -  XI successfully recovered from the connection loss and   
    successfully wrote the file, however since the communication channel  
    was set to append, it appended to the partial file that was written   
    before the database connection loss. This is not correct. The file    
    should have been overwritten after the recovery even though the communication
    channel was configured to append.                                     
    Can anyone help me on this regard.
    Thanks,
    Soorya.

    Hi Venkat,
    I would suggest u to split the file in to chunks if u face any problem in processing at a time in append mode and also
    Memory Requirements are must 4 processing huge files:
    Q: Which memory requirements does the File Adapter have? Is there a restriction on the maximum file size it can process?
    A: The maximum file size that can be processed by the File Adapter depends on a number of factors:
    o The most important one is the size of the Java heap, which is shared among all messages processed at a certain point in time. In order to be able to process larger messages without an out of memory error (OOM), it is recommended to increase the size of the available Java heap and/or to reduce the concurrency in the system so that fewer messages are processed in parallel.
    o Another factor negatively influencing the maximum message size in releases up to and including XI 3.0 SP 13 is an enabled charcter set (encoding) conversion if the message type is set to "Text".
    o Using the transport protocol "File Transfer Protocol (FTP)" also uses more memory for processing than the transport protocol "File System (NFS)" (up to and including XI 3.0 SP 13).
    o If the Message Protocol "File Content Conversion" is used in a File Sender channel, consider that not only the size of the input file affects the File Adapter's memory usage, but even more the size of the XML resulting from the conversion, which is usually a few factors larger than the original plain text file.
    To reduce the memory consumption in this scenario, consider configuring the setting "Maximum Recordsets per Message" for the sender channel. This will cause the input file to be split into multiple smaller mesages.
    Plz do refer the following links:
    U may plan the availability of ur communication channel using "Planning Availability Times" feature
    http://help.sap.com/saphelp_nw04/helpdata/en/45/06bd029da31122e10000000a11466f/frameset.htm
    /people/sravya.talanki2/blog/2005/11/29/night-mare-processing-huge-files-in-sap-xi
    hi check the below links for reference
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10748ef7-b2f0-2910-7cb8-c81e7f284af5
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7086f109-aaa7-2a10-0cb5-f69bd2affd2b
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2498bf90-0201-0010-4884-83568752a857
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cc1ec146-0a01-0010-90a9-b1df1d2f346f
    Regards,
    Vinod.

  • File Receiver Adapter - Content Conversion

    Dear All,
    We are using <b>DB to file Scenario</b>.We are using File Content conversion to get a File Comma Separated.
    Data is picked up from the DB and our payload before getting in to File adapter is given below.
      <?xml version="1.0" encoding="UTF-8" ?>
         <ns6:AssoInfo_MT xmlns:ns6="urn:NDB2File2DB">
         <AssoInfoList>
          <AssoInfoNode>
           <Name>ABCX</Name>
           <ID>31154</ID>
           <Salary>10000.0</Salary>
          </AssoInfoNode>
         <AssoInfoNode>
           <Name>ASDAS</Name>
           <ID>18978</ID>
           <Salary>10000.0</Salary>
         </AssoInfoNode>
         </AssoInfoList>
      </ns6:AssoInfo_MT>
    In File content conversion we are giving
         <b>AssoInfoNode.addHeaderLine = 0
            AssoInfoNode.fieldSeparator = ,
            AssoInfoNode.endSeparator = 'nl'</b>
    We are getting output as
    <b>ABCX,ASDAS</b>
    But the <b>expected</b> output is
    ABCX,31154,10000.0
    ASDAS,18978,10000.0
    What change we need to do in our File Receiver Adapter configuration.
    Regards,
    Vedavyas

    Hello,
    Test without these 2 options :
         AssoInfoNode.addHeaderLine = 0
         AssoInfoNode.endSeparator = 'nl'
    I think your problem is with the "endSeparator", it is not necessary.
    A new line is created for each new AssoInfoNode automaticaly.
    Regards,
    Chris

  • Content Conversion - File Receiver

    Hi All,
    I am facing problems with File Content Conversion in the File Receiver adapter.
    Input XML File
    ===============
    <?xml version="1.0" encoding="utf-8"?>
    <ns:mt_Hyp_FICO057 xmlns:ns="http://Astra-Honda.com/Prime/FICO/FICO057">
    <userlist>
         <user>
              <Year>2005</Year>
              <Month>Jan</Month>
              <Version>0</Version>
              <Value>64</Value>
              <CostCenter>P13000</CostCenter>
         </user>
         <user>
              <Year>2006</Year>
              <Month>FEB</Month>
              <Version>0</Version>
              <Value>264</Value>
              <CostCenter>P13000</CostCenter>
         </user>
    </userlist>
    </ns:mt_Hyp_FICO057>
    I have set the Content Conversion parameters in receiver File Adapter as
    Recordset Structure = user
    user.fieldSeparator = ;
    but i am getting the output only as
    Output
    ======
    2005;2006
    it is not considering other fields.
    Can anyone help.
    Thanks in Advance
    Chemmanz

    hey
    also specify the end separator
    <b>user.endSeparator='nl'</b>
    rgerads
    jithesh

  • File receiver: Dynamic Filenames error

    Hi
    I get an error in my File receiver adapter..
    Receiver Adapter v1730 for Party '', Service 'SenderSystem':
    Configured at 19:32:43 2005-08-01
    Last message processing started 19:33:26 2005-08-01, Error: Message processing failed with java.text.ParseException: Variable 'test' not found in variable substitution table
    We are currently on XI Sp12 patch level3.I have enabled the Variable substitution option and have defined a variable "test" used in defining the file name scheme.The reference points to a node value in the payload.
    I have checked the config xml for the channel which does contain this value test in the variable table..Am I missing anything???
    the config xml is as below:
    [code]2005-08-01 19:32:43 : ToFile
    Raw configuration data ***
    Transport protocol: File, version
    Message protocol: File, version 3.0.0527
    ftp.user|anonymous
    file.varSubstitution|true
    file.adapterStatus|active
    file.addParameterParams|*** TABLE , 0 ROWS DEFINED ***
    file.execute|
    file.targetFileName|%test%.xml
    ftp.overwrite|false
    file.counterMode|immediately
    file.encoding|
    file.overwrite|true
    ftp.transferMode|bin
    ftp.anonymous|false
    ftp.port|21
    file.advanced|false
    file.varSubstitutionDisableSecurity|true
    ftp.targetDir|null
    ftp.host|null
    file.counterSeparator|
    file.counterFormat|00000
    file.varSubstitutionParams|*** TABLE , 1 ROWS DEFINED ***
    file.varSubstitutionParams|file.varSubstitutionParams$0$file.varSubstitutionParamName$test
    file.varSubstitutionParams|file.varSubstitutionParams$0$file.varSubstitutionParamValue$payload:input,1,filenode,1,filename,1
    file.type|bin
    file.targetDir|//10.201.103.253/download
    ftp.password|***
    ftp.putSafe|YES
    file.writeMode|addTimeStamp
    ftp.writeMode|addTimeStamp
    file.recordsetStructure|null
    file.conversionParameters|*** TABLE , 0 ROWS DEFINED ***
    ftp.connection|permanently
    file.counterStep|1
    Used configuration data ***
    'MessageProtocol': 'File'
    'TransportProtocol': 'File'
    'file.adapterStatus': 'active'
    'file.advanced': 'false'
    'file.encoding': ''
    'file.execute': ''
    'file.overwrite': 'true'
    'file.targetDir': '//10.201.103.253/download'
    'file.targetFileName': '%test%.xml'
    'file.type': 'bin'
    'file.varSubstitution': 'true'
    'file.varSubstitutionDisableSecurity': 'true'
    'file.waitForExecute': '0'
    'file.writeMode': 'addTimeStamp'
    OK - initialized
    [/code]

    Sri,
    You have specified payload:input,1..... in ur variable substitution configuration. Is "input" the name of ur Message Type object in repository. If not, specify the name of the Message Type referred to in ur inbound interface.
    We tried this option and generated an additional field in the XML data given as input to the file receiver adapter, to be used for substitution purpose only. We avoided specifying this field in our content conversion , however it still gets written to the file!! if u able to crack it let us know
    -Saravana

  • IDoc to File - Russian Characters not in UTF-8 format - File Receiver

    Hello,
    My scenario is Idoc to File. My SAP sender system is a Unicode system and my RFC connection to XI is also set to a unicode connection. My idoc is sent to XI OK and whenever I look at the payload in SXMB_MONI, I see the Russian characters OK, but the problem is when the file gets created.
    My receiver system wants the file in UTF-8 format.  When the file gets created, the Russian characters are not in UTF-8 encoding format. For example, the Russian chars look like (but without the spaces inbetween): Ð # Ð µ Ñ # Ð ¶ Ð ° Ñ # Ð µ Ð » Ñ ...
    Instead, the chars should look like: Держатель
    My file type in my file receiver comm channel is binary and I am also using the AF_Modules/XMLAnonymizerBean with anonymizer.encoding of utf-8.
    Can someone please help me determine the problem?
    Thank you,
    Rhonda

    Hi Rhonda,
    Hope you have set the following for your file receiver adapter :
    1. Transfer Mode is set to Binary,
    2. File Type Text,
    3. Encoding ISO-8859-1( for Western European Latin ).
    Inorder to recognize russian Character, try as follows :
    Your sender idoc after coming into Pi has XML encoding declaration 'UTF-8'.
    Write a simple XSLT mapping to change the value of the attribute "encoding" to "ISO-8859-1" in the output XML of message mapping . Include this XSLT map as the second mapping step in your interface mapping.
    First step in your interface mapping will be your already existing message mapping.
    An example of the XSL code :
    <?xml version='1.0'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method='xml' encoding='ISO-8859-1' />
    <xsl:template match="/">
    <xsl:copy-of select="*" />
    </xsl:template>
    </xsl:stylesheet>
    Iam not sure whether Russian language encoding has ISO-8859-2 (Eastern European Latin) or
    ISO-8859-1( for Western European Latin )...pls check out !
    or you can also do java mapping instead of above mentioned xslt mapping  if you are comfortable with java code !
    Cheers,
    Ram.

  • Russian Characters not in UTF-8 format - File Receiver

    Hello,
    My scenario is Idoc to File.  My SAP sender system is a Unicode system and my RFC connection to XI is also set to a unicode connection.  My idoc is sent to XI ok and whenever I look at the payload in sxmb_moni, I see the Russian characters ok, but the problem is when the file gets created.  When the file gets created, the Russian characters are in unicode html encoding representation and not in UTF-8 encoding format.  For example, the Russian chars look like (but without the spaces inbetween): & # x 4 1 2 ; & # x 4 2 b ; & # x 4 2 5 ; & # x 4 1 e ; & # x 4 1 4 ; & # x 4 1 d ; & # x 4 1 e ;
    My file type in my file receiver comm channel is binary and I am also using the AF_Modules/XMLAnonymizerBean with anonymizer.encoding of utf-8.
    Can someone please help me determine the problem?
    Thank you,
    Rhonda
    Edited by: Rhonda Wilcox on Feb 18, 2009 3:14 PM

    A simple copy XSLT would help, as XSLT deescapes automatically:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="xml" omit-xml-declaration="yes"/>
    <!--  copy payload -->
      <xsl:template match="*">
      <xsl:copy-of select="." />
      </xsl:template>
      </xsl:stylesheet>
    But try to solve the issue in the IDoc sender first.
    Regards
    Stefan

  • Issue Using C# to Get RTF Text From Clipboard to Outlook With Formatting and Without Encoding Tags

    I have created a little application that gathers data from various text boxes and then combines the data into a formatted richTextBox.  A person using the tool asked if I could then add a button that would allow that text (with formatting) to be copied
    and pasted into an Outlook Email.  When I do this, I can get the text into an email, but I either strip out the formatting or I get all the RTF encoding tags to come along with it. 
    I have tested to see that the copy of the data from the richTextBox has indeed made it to the clipboard correctly.  This has been verified by the fact that I can manually press "ctrl" + "v" and I can past the text with proper
    formatting into the mail body.
    I do know that I can brute force things by trying to manually wrap HTML tags around my textBox fields and then pipe that into an HTMLBody property.  In fact I can get a lot of things to work with the HTMLBody property, but while it is nice that will
    work, I feel that I must be missing something really simple while trying to work with RTF.
    I currently am pasting (using the Clipboard.GetText(TestDataFormat.RTF)) the RTF data into the Body property of the mail item.  This is bringing in all the RTF encoding tags.  I have tried to paste this directly into the RTFBody of the mail item,
    yet an execption gets thrown when executed.  Oddly, though, if I change RTFBody to HTMLBody, I do not get the exception, but I still have the RTF encoding tags in it.  Though if I feed the HTMLBody property straight, HTML text with the encoding tags,
    it will render properly.
    This has me confused then why if I feed HTMLBody HTML text with the encoding tags that it will render, but if I try and do the same for RTFBody and feed it RTF text with encoding tags it still throws an exception.  Any help in the matter would be greatly
    appreciated.  I have included the code snippet below for sending the richTextBox information to the clipboard and then attempting to retrieve it and paste it into an Outlook email.
    Thanks for the help.
    Some pertinent information:
    Blend for Visual Studio 2015 CTP6 (I switched from VS2012 as intellisense was added to Blend in 2015)
    Because of this Systems.Windows.Forms is not in use
    private void buttonEmail_Click(object sender, RoutedEventArgs e)
    //Copy richTextBox information to Clipboard
    Clipboard.Clear();
    richTextBox.SelectAll();
    richTextBox.Copy();
    //Get current date to add to email subject line
    DateTime myNewDate = new DateTime();
    myNewDate = DateTime.Now;
    //Create Email
    Outlook.Application myNewApplication = new Outlook.Application();
    Outlook.MailItem myNewMailIoI = myNewApplication.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
    myNewMailIoI.To = " "; //An attempt to ensure that the focus moves down to the body field
    myNewMailIoI.Subject = "IoI - " + myNewDate.Date.ToString("d");
    myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatRichText;
    //Pasting data into body of email
    myNewMailIoI.Body = Clipboard.GetText(TextDataFormat.Rtf); //This will past the text with encoding tags into email
    //If this section is uncommented, it will add a properly formatted HTML text to the email
    //myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
    //myNewMailIoI.HTMLBody = "<p>This stinks!!!</p>" + "<p style='color: green; font-size:10pt; font-family:arial'>different font and color</p>";
    myNewMailIoI.Display(); //Allow for window to be minimized
    myNewMailIoI.Display(true);

    Ok, I found the solution.  Part of the issue was caused by the confusion of the HTML body property acting as a text encoder for HTML text when a string is passed in vs the RTF Body property needing to have a plain text file taken and encoded into a
    byte stream.  Even though the RTF text is in readable text (albeit with the RTF Encoding Tags) it needs to be reencoded into a series of bytes. 
    This is where I failed to understand the previous answers.  I knew that RTF Body needed to have a array of bytes, and the previous answers seemed to indicate that the data in the clipboard was already in this byte format (this may have just been my
    misunderstanding) and that I needed to somehow take this byte array and do something with it.  My misunderstanding was that all the methods for getting values from the clipboard returned strings and not bytes.
    after some digging last night and with the few hints that were offered before, I came across a post on CodeProject (apparently I cannot post links, so I will try and include this so that you can find the postcodeproject(DOTCOM)/Questions/766917/How-to-convert-richtextbox-output-into-bytearray). 
    This showed that I needed to take the raw, RTF text with its RTF encoding tags from the clipboard and and encode it to a byte array and then pass this into the RTF Body property.  Included below is the final code such that I hope that it helps some other
    person as there seem to be a lot of searches for this on the web, but not a lot of direct answers.
    using System.Text;
    using Outlook = Microsoft.Office.Interop.Outlook;
    private void buttonEmail_Click(object sender, RoutedEventArgs e)
    //Copy richTextBox information to Clipboard
    Clipboard.Clear();
    richTextBox.SelectAll();
    richTextBox.Copy();
    //Get current date to add to email subject line
    DateTime myNewDate = new DateTime();
    myNewDate = DateTime.Now;
    //Create Email
    Outlook.Application myNewApplication = new Outlook.Application();
    Outlook.MailItem myNewMailIoI = myNewApplication.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
    //Add Subject
    myNewMailIoI.Subject = "IoI - " + myNewDate.Date.ToString("d");
    //Set Body Format to RTF
    myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatRichText;
    //Converting RAW RTF data from string to bytes. THIS IS THE FIX THAT WAS NEEDED TO MAKE IT WORK
    string myNewText = Clipboard.GetText(TextDataFormat.Rtf);
    byte[] myNewRtfBytes = Encoding.UTF8.GetBytes(myNewText); //This line cost me way too many hours of lost sleep!!!
    //Inserting RTF bytes into RTFBody property
    myNewMailIoI.RTFBody = myNewRtfBytes;
    myNewMailIoI.Display(); //Displays the newlycreated email
    //If this section is uncommented, it will add a properly formatted HTML text to the email
    //myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
    //myNewMailIoI.HTMLBody = "<p>This works for the HTMLbody property!!!</p>" + "<p style='color: green; font-size:10pt; font-family:arial'>this renders properly</p>";

  • File receiver - Get file size

    Hi all,
    In my scenario, the message mapping is such that the target message may or may not have child nodes created depending on certain conditions. I am using file receiver channel to write this target message as xml file on another server.
    The issue I am facing is - suppose child nodes are not created, the target message has only root node, and nothing else. i.e. it is empty.
    But still the file gets written on destination, because file adapter doesn't seem to have intelligence to look into the payload. So I have to manually delete such 'almost-empty' files.
    Although PI 7.0 has feature of ignoring empty files, the file I am talking of is really not of 0 kb size, as it contains namespace and root node tag. It has very small size of 1 kb, this is fixed and thus the file is easily distinguished from other larger files which contain child nodes. File size is a parameter that can be certainly used as a key here, but don't know how.
    Does anyone have any idea on -
    1) How to check file size before file receiver adapter writes it,
    2) How to prevent such file from getting written, or
    3) run a script which can detect the file size and delete them periodically / or every time file receiver writes files ?
    Regards,
    - Shankar.

    Hi,
    We have an option of empty file handling in receiver file adapter..
    <i>      Select the Handling of Empty Messages:       Write Empty File
    An empty file (length 0 bytes) is put in the target directory.
           Ignore No file is put in the target directory.</i>
    But your case namespace and root node only are available you said.
    In this type of situations ..
    We can handle in the following way..
    If target side root node having the recordset node
    root
      recordset 0..unbound
         child1 0.1
         child2   0.1
    Then create a UDF
    map from left side one node -
    exists --- UDF ---to right side root node
    In UDF
    //handle business logic and
    ....ResultList.SUPPRESS.
    if your target side does not have any recordset type of structure then..
    In messages tab change the occurrences of msg to 0..unbound and use the above UDF.
    Regards
    Chilla..

  • Decrypt and unzip a File + read a XML file received into the ZIP

    Hello,
    I need your help to develop some a complex Biztalk application.
    Here're my needs :
    Our Busness partner send us a zip file cripted with a standard PGP(Pretty Goof Privacy).
    The zip containts an XML file that i have to deal it, and some attachments file(PDF).
    So i need to know what's the best approach for the developpement of my application.
    I want to decrypt the ZIP and then Unzip the file and them read the XML file received in the zip.
    Knowimg that we already have the pipeline compenent to dectypt the file with the strandar PGP and an other pipeline compenent to unzip the File.
    Thank you

    Hi ,
    Try this code to unzip the file and send the xml message .If u face issue let me know
    namespace BizTalk.Pipeline.Component.DisUnzip
    using System;
    using System.IO;
    using System.Text;
    using System.Drawing;
    using System.Resources;
    using System.Reflection;
    using System.Diagnostics;
    using System.Collections;
    using System.ComponentModel;
    using Microsoft.BizTalk.Message.Interop;
    using Microsoft.BizTalk.Component.Interop;
    using Microsoft.BizTalk.Component;
    using Microsoft.BizTalk.Messaging;
    using Ionic.Zip;
    using System.IO.Compression;
    [ComponentCategory(CategoryTypes.CATID_PipelineComponent)]
    [System.Runtime.InteropServices.Guid("8bef7aa9-5da5-4d62-ac5b-03af2fb9d280")]
    [ComponentCategory(CategoryTypes.CATID_DisassemblingParser)]
    public class DisUnzip : Microsoft.BizTalk.Component.Interop.IDisassemblerComponent, IBaseComponent, IPersistPropertyBag, IComponentUI
    private System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager("BizTalk.Pipeline.Component.DisUnzip.DisUnzip", Assembly.GetExecutingAssembly());
    #region IBaseComponent members
    /// <summary>
    /// Name of the component
    /// </summary>
    [Browsable(false)]
    public string Name
    get
    return resourceManager.GetString("COMPONENTNAME", System.Globalization.CultureInfo.InvariantCulture);
    /// <summary>
    /// Version of the component
    /// </summary>
    [Browsable(false)]
    public string Version
    get
    return resourceManager.GetString("COMPONENTVERSION", System.Globalization.CultureInfo.InvariantCulture);
    /// <summary>
    /// Description of the component
    /// </summary>
    [Browsable(false)]
    public string Description
    get
    return resourceManager.GetString("COMPONENTDESCRIPTION", System.Globalization.CultureInfo.InvariantCulture);
    #endregion
    #region IPersistPropertyBag members
    /// <summary>
    /// Gets class ID of component for usage from unmanaged code.
    /// </summary>
    /// <param name="classid">
    /// Class ID of the component
    /// </param>
    public void GetClassID(out System.Guid classid)
    classid = new System.Guid("8bef7aa9-5da5-4d62-ac5b-03af2fb9d280");
    /// <summary>
    /// not implemented
    /// </summary>
    public void InitNew()
    /// <summary>
    /// Loads configuration properties for the component
    /// </summary>
    /// <param name="pb">Configuration property bag</param>
    /// <param name="errlog">Error status</param>
    public virtual void Load(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, int errlog)
    /// <summary>
    /// Saves the current component configuration into the property bag
    /// </summary>
    /// <param name="pb">Configuration property bag</param>
    /// <param name="fClearDirty">not used</param>
    /// <param name="fSaveAllProperties">not used</param>
    public virtual void Save(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, bool fClearDirty, bool fSaveAllProperties)
    #region utility functionality
    /// <summary>
    /// Reads property value from property bag
    /// </summary>
    /// <param name="pb">Property bag</param>
    /// <param name="propName">Name of property</param>
    /// <returns>Value of the property</returns>
    private object ReadPropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName)
    object val = null;
    try
    pb.Read(propName, out val, 0);
    catch (System.ArgumentException )
    return val;
    catch (System.Exception e)
    throw new System.ApplicationException(e.Message);
    return val;
    /// <summary>
    /// Writes property values into a property bag.
    /// </summary>
    /// <param name="pb">Property bag.</param>
    /// <param name="propName">Name of property.</param>
    /// <param name="val">Value of property.</param>
    private void WritePropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName, object val)
    try
    pb.Write(propName, ref val);
    catch (System.Exception e)
    throw new System.ApplicationException(e.Message);
    #endregion
    #endregion
    #region IComponentUI members
    /// <summary>
    /// Component icon to use in BizTalk Editor
    /// </summary>
    [Browsable(false)]
    public IntPtr Icon
    get
    return ((System.Drawing.Bitmap)(this.resourceManager.GetObject("COMPONENTICON", System.Globalization.CultureInfo.InvariantCulture))).GetHicon();
    /// <summary>
    /// The Validate method is called by the BizTalk Editor during the build
    /// of a BizTalk project.
    /// </summary>
    /// <param name="obj">An Object containing the configuration properties.</param>
    /// <returns>The IEnumerator enables the caller to enumerate through a collection of strings containing error messages. These error messages appear as compiler error messages. To report successful property validation, the method should return an empty enumerator.</returns>
    public System.Collections.IEnumerator Validate(object obj)
    // example implementation:
    // ArrayList errorList = new ArrayList();
    // errorList.Add("This is a compiler error");
    // return errorList.GetEnumerator();
    return null;
    #endregion
    /// <summary>
    /// this variable will contain any message generated by the Disassemble method
    /// </summary>
    private System.Collections.Queue _msgs = new System.Collections.Queue();
    #region IDisassemblerComponent members
    /// <summary>
    /// called by the messaging engine until returned null, after disassemble has been called
    /// </summary>
    /// <param name="pc">the pipeline context</param>
    /// <returns>an IBaseMessage instance representing the message created</returns>
    public Microsoft.BizTalk.Message.Interop.IBaseMessage
    GetNext(Microsoft.BizTalk.Component.Interop.IPipelineContext pc)
    // get the next message from the Queue and return it
    Microsoft.BizTalk.Message.Interop.IBaseMessage msg = null;
    if ((_msgs.Count > 0))
    msg = ((Microsoft.BizTalk.Message.Interop.IBaseMessage)(_msgs.Dequeue()));
    return msg;
    /// <summary>
    /// called by the messaging engine when a new message arrives
    /// </summary>
    /// <param name="pc">the pipeline context</param>
    /// <param name="inmsg">the actual message</param>
    public void Disassemble(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
    IBaseMessage Temp = inmsg;
    using (ZipFile zip = ZipFile.Read(inmsg.BodyPart.GetOriginalDataStream()))
    foreach (ZipEntry e in zip)
    var ms = new MemoryStream();
    IBaseMessage outMsg;
    outMsg = pc.GetMessageFactory().CreateMessage();
    outMsg.AddPart("Body", pc.GetMessageFactory().CreateMessagePart(), true);
    outMsg.Context=inmsg.Context;
    e.Extract(ms);
    string XMLMessage = Encoding.UTF8.GetString(ms.ToArray());
    MemoryStream mstemp = new System.IO.MemoryStream(
    System.Text.Encoding.UTF8.GetBytes(XMLMessage));
    outMsg.GetPart("Body").Data = mstemp;
    _msgs.Enqueue(outMsg);
    #endregion
    Thanks
    Abhishek

  • Encoded data to  files

    Hi Expts,
    My requirement is i have to encoded data to  files using file receiver adapter.
    am also using FCC.
    can anybody help me on this how to approach.
    Thanks&Regards,
    Mp Reddy

    Hi,
    >>>>My requirement is i have to encoded data to files using file receiver adapter.
    in file receiver adapter specify encoding in:
    - select  File Type
    - then Text
    - next under File Encoding, specify a code page.
    examples of code pages from:
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    this way your file will be encoded
    Regards,
    Michal Krawczyk

  • Adapter Module Filename in File Receiver Channel

    Hi All,
    is it possible to set the Filename in File Receiver Adapter from Adapter Module?
    I know that it is possible to read the data      
    Channel ch = new Channel(moduleContext.getChannelID());
    path = ch.getValueAsString("file.targetDir");
    I Need to set the filename in Adapter Module, using of Payload is not possible because Payload is not xml.
    Dynamic Parameters in Message Header is not possible because it is an multi mapping process an i need dynamic Filename for each Part
    payload after mapping is like
    MainDocument
    SubMainDocument
    MainDocument
    SubMainDocument
    i need special Name for each SubMainDocument in FileReceiverAdapter
    regards
    ralf

    Hello Stefan,
    interface mapping is an mapping  like this:
    outbound_interface => Inbound_Interface1
                                 => Inbound_Interface2
                                => Inbound_Interface3
    in sxmb_moni this looks like this
    Soap_Header
    Soap_Body
    Payloads
         =>MainDocument ( application/xml )
        => SubMainDocument ( text/xml )
         =>MainDocument ( application/xml )
        => SubMainDocument ( text/xml )
    First SubMainElement is routing to FileReceiverAdapeter A   where Filename has to be like "NameA%nr%"
    second SubMainElement is routing to FileReceiverAdapeter B   where Filename has to be like "NameB%nr%" 
    %nr% is som value from the Payload.
    Payload is not xml  because using of Conversion Argent!!
    I Think there is only one Dynamic in Header for all subelements, i have test it!
    ralf

  • File Receiver - Dynamically create filename from data in payload

    Hi there.
    Can anyone tell me the approach I need to take to be able to use the data in one field to determine the filename in the file receiver adaptor.
    I have a requirement that requires that I save a file with the following mask:
    xxxx_xxx<b><date extracted from field in payload></b>.csv
    I would appreciate any help on this.
    Thanks in advance.
    Mick.

    Hi Mick,
    you just need to use adapter specific parameters
    and you will be able to set the name in your mapping
    (from your payload)
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Maybe you are looking for

  • HELP! Finder and other applications keep crashing after application install

    Okay, this was probably not a good idea considering I did not read that it was only for snow leopard... but I downloaded the Metalik theme from Julien Sagot's webpage (http://juliensagot.com/). Now, when I logged out and logged back into my account,

  • Designing a 'sample time feed' for Spry XML Data Set

    Hi! Often when I call a Spry XML Data Set I find I can't get the schema. If offers you the option to design a sample time feed but doesn't give you enough info to be able to even guess how to do this. Is the answer in modifying that php line somehow?

  • Low image quality on Android using CameraRoll.addBitmapData

    When using CameraRoll.addBitmapData on Android the resulting .jpg's quality is quite low in what looks like 50% jpg compression. In iOS the quality is much better. How do I reduce the compression on Android and increase the image quality? I don't qui

  • Form on Table - Where is Where Clause?

    I am a newbie so sorry if this is a easy question. I created a form on a table. Each user will have one record on the table for them. When they access this page, I want the form to either allow them to create their record for the first time or update

  • Retraction

    hello Friends, May be this is very foolish question but seriously i would like know. Friends, is it possible to send a data from BW to R/3 which is called as retraction. Till now i didn't heard about this but just woould like to know. And if it yes t