How to append binary data to existing file in OSB

Hi,
I have an OSB project that I need for it to append binary data via ftp.  Here's my current flow:
MFL binary output --> Replace $body with mfl binary output --> Publish to action (Business service that's configured to ftp binary data).
However, when the data is ftp'ed the following error is thrown:
URI = ftp://xxx:21/opt/home/zzz/logs
Request metadata =
    <xml-fragment>
      <tran:headers xsi:type="ftp:FtpRequestHeaders" xmlns:ftp="http://www.bea.com/wli/sb/transports/ftp" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:xsi="h
ttp://www.w3.org/2001/XMLSchema-instance">
        <ftp:fileName>11802_insert_oh_xfrmr.eai_data</ftp:fileName>
      </tran:headers>
      <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
      <ftp:isFilePath xmlns:ftp="http://www.bea.com/wli/sb/transports/ftp">false</ftp:isFilePath>
    </xml-fragment>
Payload =
19266787^CLLL^C711791^CLLL^C^C1178213^CSingle Phase(1)^C63185066204^CA^CConstructed^C358880 NW 4 DR LK MONTAZA^C120/240^C09361^CN/A^CProposed Remove^CAerial^C45718100^C
Unknown^C^CNo^CNormal Closed^CClamp^CA^C1^C2-Cover^C19266796^CNo^CNo^C15^C^CYes^CYes^CYes^C13200Y/7620 X 22860Y/13200^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C19266641^Coh_fuse_switch^C63086930001^C4^CN31^CDD0613^C22.9^C63376474601^C8129580^CFalse^C4^COke
echobee^C43^C0^Cdefault^CYes^C
>
####<Nov 6, 2013 2:28:23 PM EST> <Error> <WliSbTransports> <goxsd1604> <osb_server1> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <<
anonymous>> <BEA1-4B688443B66FA09FFE75> <d2b4601b2fffd9b7:6b9f2297:1422a857ee8:-8000-000000000000171b> <1383766103889> <BEA-381105> <Error occured for the service endpo
int: com.bea.wli.sb.transports.TransportException: Unable to open data connection. Message is Received error response (553) from FTP server [mpsd1] IP [10.111.19.32] po
rt [21] status [connected] upon executing command [stor opt/home/zzz/logs/11802_insert_oh_xfrmr.eai_data.a]
com.bea.wli.sb.transports.TransportException: Unable to open data connection. Message is Received error response (553) from FTP server [mpsd1] IP [10.111.19.32] port [2
1] status [connected] upon executing command [stor opt/home/icanadm/logs/11802_insert_oh_xfrmr.eai_data.a]
        at com.bea.wli.sb.transports.ftp.connector.FTPTransportProvider.sendMessage(FTPTransportProvider.java:422)
From what I understand the error code 553 represents a bad file name.  The file name that I'm supplying is 11802_insert_oh_xfrmr.eai_data but it appears that the name is changed to 11802_insert_oh_xfrmr.eai_data.a .  So I did the obvious and changed the file several different ways (without the .eai_data extension, removed the numbers from the file name) but still no luck. 
Any suggestions?
Thanks,
Yusuf

Thanks Eric.
I'm using the JCA FTP adapter instead and noticed it's appending the test generated data supplied by the OSB test console.
However, how can I ensure that the MFL output that I need to append will be placed on a new line? 
Also, how should I map/assign the MFL binary output to the opaqueElement type base64Binary defined in the WSDL file below?
Once again here's a sample payload that I need to ensure will be presented on a new line:
19266787^CLLL^C711791^CLLL^C^C1178213^CSingle Phase(1)^C63185066204^CA^CConstructed^C358880 NW 4 DR LK MONTAZA^C120/240^C09361^CN/A^CProposed Remove^CAerial^C45718100^C
Unknown^C^CNo^CNormal Closed^CClamp^CA^C1^C2-Cover^C19266796^CNo^CNo^C15^C^CYes^CYes^CYes^C13200Y/7620 X 22860Y/13200^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C19266641^Coh_fuse_switch^C63086930001^C4^CN31^CDD0613^C22.9^C63376474601^C8129580^CFalse^C4^COke
echobee^C43^C0^Cdefault^CYes
Here's the WSDL file that gets generated for the FTP adapter:
<wsdl:definitions
     name="PutGenericDevice"
     targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/ftp/AMS/Project1/PutGenericDevice"
     xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
     xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/ftp/AMS/Project1/PutGenericDevice"
     xmlns:opaque="http://xmlns.oracle.com/pcbpel/adapter/opaque/"
     xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    >
  <plt:partnerLinkType name="Put_plt" >
    <plt:role name="Put_role" >
      <plt:portType name="tns:Put_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="Put_msg">
        <wsdl:part name="opaque" element="opaque:opaqueElement"/>
    </wsdl:message>
    <wsdl:portType name="Put_ptt">
        <wsdl:operation name="Put">
            <wsdl:input message="tns:Put_msg"/>
        </wsdl:operation>
    </wsdl:portType>
</wsdl:definitions>
Here's the JCA details:
<adapter-config name="PutGenericDevice" adapter="FTP Adapter" wsdlLocation="PutGenericDevice.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
  <connection-factory location="eis/ftp/DssPut"/>
  <endpoint-interaction portType="Put_ptt" operation="Put">
    <interaction-spec className="oracle.tip.adapter.ftp.outbound.FTPInteractionSpec">
      <property name="PhysicalDirectory" value="/opt/eai/ofmw/Oracle/Middleware_R7/logs"/>
      <property name="FileType" value="binary"/>
      <property name="Append" value="true"/>
      <property name="FileNamingConvention" value="dummy.txt"/>
    </interaction-spec>
  </endpoint-interaction>
</adapter-config>
Thanks,
Yusuf

Similar Messages

  • How to extract binary data from a File?

    Hello there!
    Hope I'm right here.
    I have a slight problem with a file containing text- and binary-data. At the beginning of the file is only some text followed by some html-code and at the end is some binary stuff like a pdf oder an image (jpg/gif).
    My problem is now how to split these parts and save them in the suitable format. The text and the html are no problem, but I don't know how to extract the binary data. I tried it out with an Inputstream, but I don't know how to find the exact position where the binary data begins.
    Anyone have an idea how I can solve this?
    Thanks in advance and sorry for my bad english.

    I don't believe a bullet-proof solution exists.
    If you know where the HTML ends, you may skip whitespace and then assume the rest is binary data. Or, if you know the first bytes of the binary data, you may locate those. With either of these solutions, though, you risk coming across a file where it doesn't work as expected, for example if the first byte of the binary data happens to match a whitespace character.

  • How to write binary data to browser - File Save dialog

    Hi,
    problem:
    i have a working webservice and i get binary data from that webservice.
    my dynpro java  already works and i have byte[] b which has my binary result.
    what i want:
    when the user clicks on the button, the action onActionGetResult() is executed and inside this method, the byteArray b exists. what can i do, to say the dynpro application that it should  send the binary data direct to the browser, so that the "File Save Dialog" appears and the user can save the file to the harddisk
    any ideas?

    I've found the solution:
    IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(
    res.getUrl(WDFileDownloadBehaviour.ALLOW_SAVE.ordinal()),
    res.getResourceName());
    window.show();
    this worked for me

  • How to append contents to an existing file contents at the end of file?

    Hi all
    I am Kiran, working with LV8.0  FDS
    I find difficulty while trying to add new file contents(some messages)  to an existing file at the end /begining of a file.
    Whenever i try to do that,it is replacing the previous contents,but i dont need that. i want the contents to be appended.
    Plz suggest me.
    thanks & regards
           kiran

    Hi Kiran,
    yes, I can attach a screenshot
    (open file, set file position to end, write text, close file)
    Message Edited by GerdW on 08-16-2007 03:19 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    append.png ‏2 KB

  • How to append the data in a file

    Dear All,
    i want to continously update one text file that is
    in myfile.txt using java,
    for example username:test:password:test
    like wise how can i append this text with username and password to added in the next next line

    Take a look at this:
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.io.IOException;
    public class FileWrite {
         public static void main(String[] args) throws IOException {
              BufferedWriter br = new BufferedWriter(new FileWriter("C:\\temp.txt",true));
              br.write("Hello");
              br.newLine();
              br.close();
    }

  • How to Convert Binary Data in Binary File

    hi,
    my telecom client puts a binary file which is asn.1 encoded with BER.
    how to handle binary data in java.
    how to convert binary to hexa to ascii format
    how to convert binary to octet to ascii format
    please help me in this.
    regards,
    s.mohamed asif

    You don't need to convert the data.
    Only you can do is print it in that formats, like it:
    public static String byteArrayToHex(byte[] b) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < b.length; i++)
             sb.append(Integer.toHexString(b&255) + " ");
    return sb.toString();
    take a look at this
    http://java.sun.com/docs/books/tutorial/essential/io/

  • How do you import data base dmp file in oracle 10g

    How do you run data base dmp file in oracle 10g

    Examples..
    Table Exports/Imports
    The TABLES parameter is used to specify the tables that are to be exported. The following is an example of the table export and import syntax:
    expdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=expdpEMP_DEPT.log
    impdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=impdpEMP_DEPT.log
    For example output files see expdpEMP_DEPT.log and impdpEMP_DEPT.log.
    The TABLE_EXISTS_ACTION=APPEND parameter allows data to be imported into existing tables.
    Schema Exports/Imports
    The OWNER parameter of exp has been replaced by the SCHEMAS parameter which is used to specify the schemas to be exported. The following is an example of the schema export and import syntax:
    expdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log
    impdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR dumpfile=SCOTT.dmp logfile=impdpSCOTT.log
    For example output files see expdpSCOTT.log and impdpSCOTT.log.
    Database Exports/Imports
    The FULL parameter indicates that a complete database export is required. The following is an example of the full database export and import syntax:
    expdp system/password@db10g full=Y directory=TEST_DIR dumpfile=DB10G.dmp logfile=expdpDB10G.log
    impdp system/password@db10g full=Y directory=TEST_DIR dumpfile=DB10G.dmp logfile=impdpDB10G.log

  • Append new data to a file

    BufferedWriter out = new BufferedWriter(new FileWriter("Output.txt"));
    The above line of code will overwrite my existing Output.txt. How to append new data to Output.txt instead of overwriting?
    Thank you very much!

    Check out the FileWriter class - particularly the constructor that looks like this:FileWriter writer = new FileWriter (String filename, boolean append); Good Luck
    Lee

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • How to read data from a file in OSB

    hi guys,
    Recently, I've got a problem with reading file from specific location. I've actually followed this post OSB 11g - Read or Poll File in OSB - Oracle Fusion Middleware Blog, and then
    I know how to read a file. However, it does not as expected. Because, I've found no way to read data from the file. Therefore, no chance to manipulate the data like assigning to a variable, or extracting ....
    Hence, is there any way to read data from file by using proxy service in OSB ??? No Java code ???
    by the way, supposed that there is no way to read data from a file in OSB. So, What purposes will the way in the post above be used for?
    Many thanks in advance

    http://jakarta.apache.org/poi/hssf/index.html
    HSSF stands for Horrible Spreadsheet Format, but it still works!

  • How to Load the data from excel file(Extension is .CSV) into the temp.table

    Hi
    How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
    My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
    Kindly Suggest the Solution.
    Regards,
    Sachin

    Hello Sachin,
    You can use the following metalink note:How to Read Data from an EXCEL Spreadsheet into a Form Using Webutil Client_OLE2 (Doc ID 813535.1) and modify it a little bit.
    Instead of copy values into forms you can save them in your temporary table.
    Kind regards,
    Alex
    If someone's helpful or correct please mark it accordingly.

  • How to load the data from .csv file to oracle table???

    Hi,
    I am using oracle 10g , plsql developer. Can anyone help me in how to load the data from .csv file to oracle table. The table is already created with the required columns. The .csv file is having about 10lakh records. Is it possible to load 10lakh records. can any one please tell me how to proceed.
    Thanks in advance

    981145 wrote:
    Can you tell more about sql * loader??? how to know that utility is available for me or not??? I am using oracle 10g database and plsql developer???SQL*Loader is part of the Oracle client. If you have a developer installation you should normally have it on your client.
    the command is
    sqlldrType it and see if you have it installed.
    Have a look also at the FAQ link posted by Marwin.
    There are plenty of examples also on the web.
    Regards.
    Al

  • How to load the data from excel file into temprory table in Forms 11g?

    Hi
    How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
    My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
    Kindly Suggest the Solution.
    Regards,
    Sachin

    Declare
        v_full_filename         varchar2(500);
        v_server_path           varchar2(2000);
        v_separator             VARCHAR2(1);
        v_filename              VARCHAR2(400);
        filename                VARCHAR2 (100);
        v_stop_load             varchar2 (2000);
        v_rec_error_log         varchar2(4000);
        v_error_log             varchar2(4000);
        ctr                     NUMBER (12);
        cols                    NUMBER (2);
        btn                     number;
        RES                     BOOLEAN;   
        application             ole2.obj_type;
        workbooks               ole2.obj_type;
        workbook                ole2.obj_type;
        worksheets              ole2.obj_type;
        worksheet               ole2.obj_type;
        cell                    ole2.obj_type;
        cellType                ole2.OBJ_TYPE;
        args                    ole2.obj_type;
        PROCEDURE olearg
        IS
        args   ole2.obj_type;
        BEGIN
        args := ole2.create_arglist;
        ole2.add_arg (args, ctr);                                
        ole2.add_arg (args, cols);                                   
        cell := ole2.get_obj_property (worksheet, 'Cells', args);
        ole2.destroy_arglist (args);
        END;
    BEGIN
    v_full_filename := client_get_file_name(directory_name => null
                                     ,file_name      => null
                                     ,file_filter    => 'Excel  files (*.xls)|*.xls|'  
                                                                            ||'Excel  files (*.xlsx)|*.xlsx|'                                                                 
                                     ,message        => 'Choose Excel file'
                                     ,dialog_type    => null
                                     ,select_file    => null
    If v_full_filename is not null Then
    v_separator := WEBUTIL_CLIENTINFO.Get_file_Separator ;
    v_filename := v_separator||v_full_filename ;
    :LOAD_FILE_NAME := substr(v_filename,instr(v_filename,v_separator,-1) + 1);                                
    RES := Webutil_File_Transfer.Client_To_AS(v_full_filename,"server_path"||substr(v_filename,instr(v_filename,v_separator,-1) + 1));     
    --Begin load data from EXCEL
    BEGIN
        filename := v_server_path||substr(v_filename,instr(v_filename,v_separator,-1) + 1); -- to pick the file
        application := ole2.create_obj ('Excel.Application');
        ole2.set_property (application, 'Visible', 'false');
        workbooks := ole2.get_obj_property (application, 'Workbooks');
        args := ole2.create_arglist;
        ole2.add_arg (args, filename); -- file path and name
        workbook := ole2.get_obj_property(workbooks,'Open',args);
        ole2.destroy_arglist (args);
        args := ole2.create_arglist;
        ole2.add_arg (args, 'Sheet1');
        worksheet := ole2.get_obj_property (workbook, 'Worksheets', args);
        ole2.destroy_arglist (args);
        ctr := 2;                                                     --row number
        cols := 1;                                                -- column number
        go_block('xxx');
        FIRST_RECORD;  
        LOOP       
                --Column 1 VALUE --------------------------------------------------------------------
            olearg;
            v_stop_load := ole2.get_char_property (cell, 'Text'); --cell value of the argument
            :item1 := v_stop_load;
            cols := cols + 1;                                                      
              --Column 2 VALUE --------------------------------------------------------------------
            olearg;
            :item2 := ole2.get_char_property (cell, 'Text'); --cell value of the argument
            cols := cols + 1;
            --<and so on>
        ole2.invoke (application, 'Quit');
        ole2.RELEASE_OBJ (cell);
        ole2.RELEASE_OBJ (worksheet);
        ole2.RELEASE_OBJ (worksheets);
        ole2.RELEASE_OBJ (workbook);
        ole2.RELEASE_OBJ (workbooks);
        ole2.RELEASE_OBJ (application);
    END;
    --End load data from EXCELPlease mark it as answered if you helped.

  • How  to load the data from excel  file  into table in oracle using UTL_FI

    How to load the data from excel file into table in oracle
    and from table to excel file
    using UTL_FILE package
    Please give me some example

    This is something i tried in oracle apex
    http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
    Regards,
    CKLP

  • Writing binary data to a file without carriage returns every 512 bytes

    Is there a VI for writing binary data to a file without carriage returns being inserted every 512 bytes?
    Thanks

    Hi Momolxg,
    I could be way off on this. I tried to simulate what you've done by
    making a for loop that would run a set number of times. For my example I
    used 1025. I wired the iteration terminal to a 'Write to SGL File.vi'
    outside the loop with indexing enabled. It wrote the SGL data from 0 to
    1024 to the file. I then read the file with a 'Read Characters from
    File.vi' and searched the output for a carriage return (0D hex). It was
    found five times. The reason why was the SGL number it was reading had a
    13 (0D hex) in it. Perhaps you're running into a similar problem?
    I tried it again, this time using the 'Write to I16 File.vi'. The
    carriage return was found five times: the 28th character the first time
    then on the 512th character four consecutive time
    s after that. I suppose
    that makes sense that you'd find a 0D in the numbers at equal spacings if
    they're incrementing this way... In this case the carriage returns you're
    seeing are actually numbers from your data.
    One big difference is that I'm using a set pattern of numbers. This
    doesn't appear to be your case. Is there a better way we can duplicate
    your problem? It sounds interesting. Again my simulation could be way
    off. (I'm also running this on LV60 for Linux so my results could be
    different)
    - Kevin
    In article <[email protected]>,
    "momolxg" wrote:
    > Is there a VI for writing binary data to a file without carriage returns
    > being inserted every 512 bytes? Thanks

Maybe you are looking for

  • Solaris + iPlanet 6.0SP2 + PHP 5.1.2 + Instant Client

    Configuration: Solaris OS 5.8 (64bit) iPlanet 6.0 (SP2) (32bit) PHP v5.1.2 (32bit) Instant Client 10.2.0.1 (32 bit) I am able to compile and install php 5.1.2 and Instant Clinet 32bit libraris with my iPlanet Server. When i invoke a php script that c

  • How to create a button to load an external exe file

    hi i have an flash cs5 project so the user when clicking the button the exe file open ? the exe in folder name "puzz" the exe file name play.exe i tried this     button_1.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);        function fl_Mo

  • Personalize Page Customization

    Hello, I am trying to have a personalize page for end users to where user could hide,show portlets and add portlets from a repository, Of course we do not wants to use the default personalize option available in Oracle Portal. Could someone kindly he

  • Is it possible to see a film on appletv trough iPod  and ear sound with ear sounds with headphone of iPod?

    Is it possible to see a film on appletv trough iPod  and ear sound with headphone of iPod?

  • VARRAY in temporary table

    Hello, All. Whether somebody will answer, when Oracle will make support of types VARRAY and nested tables in the temporary tables. Even in the version 8.1.6 for NT it unfortunately is not present. And that to me needs to be used VARRAY in the tempora