B2B 11g - Managing File name from a JMS queue.

Hi,
I have configured a Listening Channel to use Generic File 1.0 (to poll a file from local dir) and send it to a Trading Partner. In B2B User Guide it has been said to have the file name as %TO_PARTY%_%DOCTYPE_NAME%_%DOCTYPE_REVISION%_%MESSAGE_ID%_TIMESTAMP.txt. Extension can be anything (txt, dat, etc).
It is necessary to have this format? What if I want to send a file with name say ABC.txt*.
How will I manage this file name pattern if I have to read the file content from a JMS queue (and then send the file to the Trading Partner).
Thanks,
Sanjay
Edited by: Sanjay Bharatiya on 24-Nov-2010 12:07 PM

Hi Anuj,
I set up AS2 in my local environment and tested it. I do not get the desired name of the file. The wire message seems to be ok. Following is the Tranport Header present in the wire message from the sender B2B server:
Message-ID=<ID:<172014.1291742389684.0>@kg_certificate> Content-Transfer-Encoding=binary MIME-version=1.0 From=kg_certificate Disposition-Notification-To=[email protected] AS2-To=exel_certificate User-Agent=AS2 Server Date=Tue, 07 Dec 2010 17:19:50 GMT AS2-Version=1.1 AS2-From=kg_certificate Content-Disposition=attachment; filename=J7Q9A7.txt Content-Type=*application/octet-stream*
Following is the Transport Header present in the wire message from the receiver B2B server:
AS2-To=exel_certificate TE=trailers, deflate, gzip, compress Date=Tue, 07 Dec 2010 17:19:50 GMT AS2-Version=1.1 Accept-Encoding=gzip, x-gzip, compress, x-compress AS2-From=kg_certificate Content-Transfer-Encoding=binary Disposition-Notification-To=[email protected] Message-ID=<ID:<172014.1291742389684.0>@kg_certificate> Content-type=application/octet-stream MSG_RECEIVED_TIME=Tue Dec 07 12:20:39 EST 2010 ECID-Context=1.0000In1qASoEoI05nzp2iZ1Cxam9001KGU;kXCmv0 MIME-version=1.0 User-Agent=AS2 Server Oracle HTTPClient Version 10h Content-Disposition=attachment; filename=J7Q9A7.txt Content-Length=211 Host=10.32.200.207:8001 Connection=Keep-Alive, TE From=kg_certificate
Things look good here but when the file is written to a directory the file name is of the form <sendername>_<doctypename>_<docrevision>_<msgtype>_*****.dat. I do not get the desired file name (J7Q9A7.txt). What am I missing?
Thanks,
Sanjay
Edited by: Sanjay Bharatiya on 7-Dec-2010 11:59 AM

Similar Messages

  • B2B 11g: Getting File Name in inbound integration and passing it to SOA

    Hi,
    I am Reading a EDI x12 file in inbound B2B .I am checking the 'preserve File Name' check Box at Listening channel properties.....Then Integrating B2B to soa using AQ Adapter.But I couldn't find any property where I can pass the file name which I read through B2b to Composite. I need the file name because I am inserting all the records in Database and client wants to see which record in DB has been inserted from which file.
    Any pointers would be helpful.

    Hello,
    Try to use the b2b.fileName property. Although it probably is not shown on the list you should be able to access it.
    Also, please check the patch 18021286 which has many improvements and allows for two cases that can be useful for you:
    - Get information on back-end about which channel and agreement was used to deliver
    - Using callout Ret values which allow for specific properties to be set on callouts and passed all the way until the back-end application.
    Hope this helps.
    Best Regards
    Tiago Teixeira

  • Getting a file name from a JMS message

    Hello,
    I am trying to unzip a jms message file, but in order to unzip it, I have to somehow have the file name in a java input stream. Since there is no message.getFileName method, I really don't know what to do.
    I am trying to do this in the onMessage method in one an MDB and it is not possible for me to have the fileName sent in the JMS header. Please help!
    Jeremy

    I got the code I am using off the sun developer's website and it uses a File Input Stream/Zip Input Stream which you need the file name of the file you are unzipping in order to unzip it.
    I guess what would be more helpful would be to know how exactly to unzip a .gz file within a JMS message. See, I am receiving a message to a queue, and upon getting this message I am to unzip the .gz file within the message and process it further through other workflows. One thing though, we are trying to do this without writing the file anywhere until we are completely done with the workflows, so this all needs to be done in the run time memory.
    As an intern, I am not that savy with these things, so any help would be greatly appreciated.

  • How to get the file name from Oracle B2B 10g

    Hi My requirement is I am getting a CSV file from Trading partner, I am using oracle 10g b2b to translate the data.
    In my BPEL 10g I am using AQ adapter to get the message from IP_IN_QUEUE.
    Now I want to get the file name Eg: SampleFile.dat of the CSV file in my BPEL process.
    I tried using the b2b.filename property in the receive activity and it is not getting the file name.
    <sequence name="main">
        <receive name="Receive_Note" partnerLink="GetB2BNote"
                 portType="ns1:Dequeue_ptt" operation="Dequeue"
                 variable="Receive_Note_Dequeue_InputVariable"
                 createInstance="yes">
                 <bpelx:property name="b2b.fileName" variable="WriteFileName"/>
        </receive>
      </sequence>
    Can you help me to get the file name from Oracle b2b 10g ?
    Thanks,
    b2b user

    Hi My requirement is I am getting a CSV file from Trading partner, I am using oracle 10g b2b to translate the data.
    In my BPEL 10g I am using AQ adapter to get the message from IP_IN_QUEUE.
    Now I want to get the file name Eg: SampleFile.dat of the CSV file in my BPEL process.
    I tried using the b2b.filename property in the receive activity and it is not getting the file name.
    <sequence name="main">
        <receive name="Receive_Note" partnerLink="GetB2BNote"
                 portType="ns1:Dequeue_ptt" operation="Dequeue"
                 variable="Receive_Note_Dequeue_InputVariable"
                 createInstance="yes">
                 <bpelx:property name="b2b.fileName" variable="WriteFileName"/>
        </receive>
      </sequence>
    Can you help me to get the file name from Oracle b2b 10g ?
    Thanks,
    b2b user

  • Oracle b2b not preserving file name

    Hi all,
    I have a requirement that my trading partner will send files over AS2 which I have to deliver to other application. In my case file name is important and I have to preserve the file name whatever my TP is sending.
    I have created all the things like remote TP , AS2 channel,agreement etc and I can receive the file over AS2. in b2b console it's showing the file is received successfully.Even I can see the file name in the wire message
    Message-ID=<GOANYWHERE-AS2-20120516-121623738-1337116991845@GoAnyTest_KGSOADEVCERT> EDIINT-Features=multiple-attachments Disposition-Notification-To=GoAnyTest AS2-To=KGSOADEVCERT MSG_RECEIVED_TIME=Wed May 16 12:16:22 EDT 2012 Mime-Version=1.0 Host=10.96.4.34:8001 User-Agent=GoAnywhere Director/4.0.0 Content-Length=150 Date=Wed, 16 May 2012 12:16:23 -0400 AS2-Version=1.2 AS2-From=GoAnyTest Content-Disposition=attachment; filename="EDI.FCSMFCSMSAPT_RTN1205010000.txt" Content-Type=text/plain; name=EDI.FCSMFCSMSAPT_RTN1205010000.txt Connection=close
    Probem scenrio 1:
    I have created a file channel in my host trading partner and I have incorporated that file channel in the in the agreement but b2b is generating file with it's own naming convension(e.g. if TP sending the file name as abc.txt but b2b is generating as MCKESSON_MC_FixedLengthDocs_MC_CustomDocVer1.0_1_0A6004221375839D239000005EC36F4B-1.dat)
    Probem scenrio 2:
    I have not mentioned any delivery channel for my host TP in the agreement and the message is coming in B2B_IN_QUEUE jms queue and I can see the file name in a JMS property(key/value pair).
    ACTION_NAME contentType:text/plain; name=EDI.FCSMFCSMSAPT_RTN1205010000.txt;filename:EDI.FCSMFCSMSAPT_RTN1205010000.txt
    But when I have created a JMS channel (with my custom JMS queue) in my host trading partner and have incorporated that JMS channel in the in the agreement I can't see the above propery though the message is getting enqueued in the queue. I can see a bunch of jms properties except the ACTION_NAME.
    I can't use B2B_IN_QUEUE as it is being used by other applcations.
    Please urgently help.
    Regards,
    Anindya

    Seems like you are hitting a known bug. Please log a SR with support.
    Regards,
    Anuj

  • How to delete file names from Adobe Reader list

    How can I delete file names from the Adobe Reader list?  I have deleted the file & it's empty, but deleted file names remain in my list & it's very annoying.  I can't seem to find an option anywhere to delete the file names.

    Thanks for the answer, I will try this & post my results with this method.  I have set the amount to zero, & it seems if I want to put back valid files into my list I first need to find them in another file in my pc, such as documents, open them in Adobe Reader, & then then they will reappear in the Adobe Reader list.  Is this correct?  Thank you!
    This seems to be the case, you need to restore each file you want in your list one by one by accessing them elsewhere on your pc, & then you must open them with Adobe Reader to have files reappear in your Adobe Reader list.  However, this seems to be a tedious process if you only want to delete one obsolete file from your list by first emptying the list & rebuilding it file by file.  It works, but I'm wondering if there is a more sensible & efficient way to do this?

  • How can I assign image file name from Main() class

    I am trying to create library class which will be accessed and used by different applications (with different image files to be assigned). So, what image file to call should be determined by and in the Main class.
    Here is the Main class
    import org.me.lib.MyJNIWindowClass;
    public class Main {
    public Main() {
    public static void main(String[] args) {
    MyJNIWindowClass mw = new MyJNIWindowClass();
    mw.s = "clock.gif";
    And here is the library class
    package org.me.lib;
    public class MyJNIWindowClass {
    public String s;
    ImageIcon image = new ImageIcon("C:/Documents and Settings/Administrator/Desktop/" + s);
    public MyJNIWindowClass() {
    JLabel jl = new JLabel(image);
    JFrame jf = new JFrame();
    jf.add(jl);
    jf.setVisible(true);
    jf.pack();
    I do understand that when I am making reference from main() method to MyJNIWindowClass() s first initialized to null and that is why clock could not be seen but how can I assign image file name from Main() class for library class without creating reference to Main() from MyJNIWindowClass()? As I said, I want this library class being accessed from different applications (means different Main() classes).
    Thank you.

    Your problem is one of timing. Consider this simple example.
    public class Example {
        public String s;
        private String message = "Hello, " + s;
        public String toString() {
            return message;
        public static void main(String[] args) {
            Example ex = new Example();
            ex.s = "world";
            System.out.println(ex.toString());
    }When this code is executed, the following happens in order:
    1. new Example() is executed, causing an object to constructed. In particular:
    2. field s is given value null (since no value is explicitly assigned.
    3. field message is given value "Hello, null"
    4. Back in method main, field s is now given value "world", but that
    doesn't change message.
    5. Finally, "Hello, null" is output.
    The following fixes the above example:
    public class Example {
        private String message;
        public Example(String name) {
            message = "Hello, " + name;
        public String toString() {
            return message;
        public static void main(String[] args) {
            Example ex = new Example("world");
            System.out.println(ex.toString());
    }

  • File name from a path

    hi ,
    there is a path "c:\abc\abc\abc\abc\abc.doc", i have to get file name from it.
    but i had to write a dynamic code which can get the file name from any given path.

    Smoke me a kipper, I'll be back before breakfast.
    SQL> var extended_filepath varchar2(128)
    SQL> exec :extended_filepath := '/this/is/a/path/to/a/file.txt'
    PL/SQL procedure successfully completed.
    SQL> select instr(:extended_filepath, '/', -1)
      2  from dual
      3  /
    INSTR(:EXTENDED_FILEPATH,'/',-1)
                                  21
    SQL> select substr(:extended_filepath, instr(:extended_filepath, '/', -1) +1)
      2  from dual
      3  /
    SUBSTR(:EXTENDED_FILEPATH,INSTR(:EXTENDED_FILEPATH,'/',-1)+1)
    file.txt
    SQL> Cheers, APC

  • Retreiving the file names from directory inside another directory from application server

    Hi,
    I had a problem in retreiving the file names from a directory inside another directory.
    I tried using the FM's  SUBST_GET_FILE_LIST, RZL_READ_DIR_LOCAL and EPS_GET_DIRECTORY_LISTING
    But here I am getting only one directory details.
    Actually my file is located a directory inside one more directory and one more directory and inside the files are located.
    i.e total 3 directories inside the 3rd one my files are there.
    I need to read the latest file name in the directory.
    So that i can do some manipulation after getting the file name.
    Is there option like OPEN DATASET , READ DATASET and CLOSE DATASET?
    Can anyone please let me know How can i acheive this one.
    Regards
    Ram

    Hi Ram,
        Following thread can be helpful for you, were it shows in the tables structure rsfillst a field RSFILLST-TYPE whether its a directory or file..........
    http://scn.sap.com/thread/865272
    thanks and regards,
    narayan

  • How to get the target file name from an URL?

    Hi there,
    I am trying to download data from an URL and save the content in a file that have the same name as the file on the server. In some way, what I want to do is pretty similar to what you can do when you do a right click on a link in Internet Explorer (or any other web browser) and choose "save target as".
    If the URL is a direct link to the file (for example: http://java.sun.com/images/e8_java_logo_red.jpg ), I do not have any problem:
    URL url = new URL("http://java.sun.com/images/e8_java_logo_red.jpg");
    System.out.println("Opening connection to " + url + "...");
    // Copy resource to local file                   
    InputStream is = url.openStream();
    FileOutputStream fos=null;
    String fileName = null;
    StringTokenizer st=new StringTokenizer(url.getFile(), "/");
    while (st.hasMoreTokens())
                    fileName=st.nextToken();
    System.out.println("The file name will be: " + fileName);
    File localFile= new File(System.getProperty("user.dir"), fileName);
    fos = new FileOutputStream(localFile);
    try {
        byte[] buf = new byte[1024];
        int i = 0;
        while ((i = is.read(buf)) != -1) {
            fos.write(buf, 0, i);
    } catch (Throwable e) {
        e.printStackTrace();
    } finally {
        if (is != null)
            is.close();
        if (fos != null)
            fos.close();
    }Everything is fine, the file name I get is "e8_java_logo_red.jpg", which is what I expect to get.
    However, if the URL is an indirect link to the file (for example: http://javadl.sun.com/webapps/download/AutoDL?BundleId=37719 , which link to a file named JavaSetup6u18-rv.exe ), the similar code return AutoDL?BundleId=37719 as file name, when I would like to have JavaSetup6u18-rv.exe .
    URL url = new URL("http://javadl.sun.com/webapps/download/AutoDL?BundleId=37719");
    System.out.println("Opening connection to " + url + "...");
    // Copy resource to local file                   
    InputStream is = url.openStream();
    FileOutputStream fos=null;
    String fileName = null;
    StringTokenizer st=new StringTokenizer(url.getFile(), "/");
    while (st.hasMoreTokens())
                    fileName=st.nextToken();
    System.out.println("The file name will be: " + fileName);
    File localFile= new File(System.getProperty("user.dir"), fileName);
    fos = new FileOutputStream(localFile);
    try {
        byte[] buf = new byte[1024];
        int i = 0;
        while ((i = is.read(buf)) != -1) {
            fos.write(buf, 0, i);
    } catch (Throwable e) {
        e.printStackTrace();
    } finally {
        if (is != null)
            is.close();
        if (fos != null)
            fos.close();
    }Do you know how I can do that.
    Thanks for your help
    // JB
    Edited by: jb-from-sydney on Feb 9, 2010 10:37 PM

    Thanks for your answer.
    By following your idea, I found out that one of the header ( content-disposition ) can contain the name to be used if the file is downloaded. Here is the full code that allow you to download locally a file on the Internet:
          * Download locally a file from a given URL.
          * @param url - the url.
          * @param destinationFolder - The destination folder.
          * @return the file
          * @throws IOException Signals that an I/O exception has occurred.
         public static final File downloadFile(URL url, File destinationFolder) throws IOException {
              URLConnection urlC = url.openConnection();
              InputStream is = urlC.getInputStream();
              FileOutputStream fos = null;
              String fileName = getFileName(urlC);
              destinationFolder.mkdirs();
              File localFile = new File(destinationFolder, fileName);
              fos = new FileOutputStream(localFile);
              try {
                   byte[] buf = new byte[1024];
                   int i = 0;
                   while ((i = is.read(buf)) != -1) {
                        fos.write(buf, 0, i);
              } finally {
                   if (is != null)
                        is.close();
                   if (fos != null)
                        fos.close();
              return localFile;
          * Returns the file name associated to an url connection.<br />
          * The result is not a path but just a file name.
          * @param urlC - the url connection
          * @return the file name
          * @throws IOException Signals that an I/O exception has occurred.
         private static final String getFileName(URLConnection urlC) throws IOException {
              String fileName = null;
              String contentDisposition = urlC.getHeaderField("content-disposition");
              if (contentDisposition != null) {
                   fileName = extractFileNameFromContentDisposition(contentDisposition);
              // if the file name cannot be extracted from the content-disposition
              // header, using the url.getFilename() method
              if (fileName == null) {
                   StringTokenizer st = new StringTokenizer(urlC.getURL().getFile(), "/");
                   while (st.hasMoreTokens())
                        fileName = st.nextToken();
              return fileName;
          * Extract the file name from the content disposition header.
          * <p>
          * See <a
          * href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html">http:
          * //www.w3.org/Protocols/rfc2616/rfc2616-sec19.html</a> for detailled
          * information regarding the headers in HTML.
          * @param contentDisposition - the content-disposition header. Cannot be
          *            <code>null>/code>.
          * @return the file name, or <code>null</code> if the content-disposition
          *         header does not contain the filename attribute.
         private static final String extractFileNameFromContentDisposition(
                   String contentDisposition) {
              String[] attributes = contentDisposition.split(";");
              for (String a : attributes) {
                   if (a.toLowerCase().contains("filename")) {
                        // The attribute is the file name. The filename is between
                        // quotes.
                        return a.substring(a.indexOf('\"') + 1, a.lastIndexOf('\"'));
              // not found
              return null;
         }

  • Flat file name from Sender Side Dynamically into subject of Receiver Mail

    Hi All,
             I am Using a file to Mail Scenario, My requirement is to get dynamically the file name from flat file of the Sender Side into Subject of Receiver Mail Adapter and attachment of file from the Sender Side. Can anyone help me out.
    Thanks in Advance

    Hi....
              You can write udf in the message mapping to get the Dynamic file name and map that to the subject of the receiver mail.
      DynamicConfiguration conf = (DynamicConfiguration) param.get(
              StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
          // read value
          String Filename = conf.get(KEY_FILENAME);
    Regards,
    Leela

  • Retrieve file name from full file path

    I am trying to retrieve a file name from a path (ex. c:\temp\tes.txt) using the following code, but it is given me an error of "The method split(String) in the type String is not applicable for the arguments (char).
    {code}
    String filepath = item.getName();
    String[] buf = filepath.split('/');
    String filename = buf[buf.length-1];
    {code}
    I tried to use double quote instead of single quote, but it is not returning anything.
    {code}
    String[] buf = filepath.split("/");
    {code}
    Anyone knows why? Thanks.

    How is this related to JDBC?
    Anyway, is the path separator actually a forward slash? Isn't it a backward slash?
    If you're using Apache Commons FileUpload (which I guess, the 'item.getName()' is recognizeable), then just read their FAQ: [http://commons.apache.org/fileupload/faq.html#whole-path-from-IE].

  • Same file name from sender to receiver file adapter with out using UDF

    Hi All,
    I am working on FILE TO FILE. My requirement is same file name from sender to receiver file adapter. Is it possible to do using only Adapter Specific message properties?  i mean with out using UDF.
    Thanks
    Karthik

    Hi,
    >>>Is it possible to do using only Adapter Specific message properties?
    yes
    just enable Adapter Specific message properties in sender and receiver channel for file name
    and you're done
    Regards,
    Michal Krawczyk

  • File name from an attribute of an element of the payload

    Dear Experts,
    Could you suggest the syntax for specifying the file name from a variable in the file receiver communication channel? I need to grab the file name from an ATTRIBUTE of an element of the payload.
    Thanks a lot.
    Example: Need to pass the attribute "descReceipt" of the element "promotionEvent" to the variable in the following payload:
    <?xml version="1.0" encoding="UTF-8"?>
    <promotionExport>
    <promotionEvent eventIdentifier="30" status="A" descReceipt="FILE1">

    The scenario is IDOC to FILE. I need to get the value of the receiving partner.
    The message header has the node "DynamicConfiguration". Please see the xml below. I need to grab the key RCVPRN (0000002104) from this and pass as the file name in the receiver file adapter.
    How do I setup my receiver file adapter for this? I tried changing the values for the variable, and also enabling the adapter specific message attributes. No solution yet.
    <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="RCVPOR">LXDCLNT250</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="SNDPRT">LS</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="RCVPRN">0000002104</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="SNDPOR">SAPLCD</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="SNDPRN">LCDCLNT220</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="CIMTYP" />
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="IDOCTYP">WPDBBY01</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="MESTYP">WPDBBY</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="RCVPRT">KU</SAP:Record>
      </SAP:DynamicConfiguration>

  • Can we possible to retrive the file name from the directory...?

    Can we possible to retrive the list of files or file names from the directory...?
    The directory called create or replace directory [directory_name] as ....

    Yeah, yeah its very good example for this scenario.
    I agree. But, I want to learn about Java based PL/SQL code development for that just I am asking any link for this kind of material.....:-)

Maybe you are looking for