Get file content as reponse

Hi all,
I am desinging a webform in .net, where I have an option to select the file/document, or I shall pass the file Id/filename as request via http. And I have to get the filecontent/payload of the file as response.
Regards,
Varun

Hi,
you can pass the files as attachments with SOAP
Refer
SAP Network Blog: How-to create a web service with attachments (SOAP With Attachments)
How-to create a web service with attachments (SOAP With Attachments)
refer discussion
Posting to a .NET web service using SOAP adapter
Thanks
Swarup
Edited by: Swarup Sawant on Aug 20, 2008 11:18 AM

Similar Messages

  • Can't get File content conversion to produce CSV file

    Hi Guys
    Have no problem at all getting XML file created via an RFC
    Structure is something like this
    From MONI message monitor inbound message    payload
    <?xml version="1.0" encoding="UTF-8" ?>
    - <rfc:Z_XI_005_RFC xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    - <IP_CUSTOMER_HEADER>
      <CUSTOMERID>100853</CUSTOMERID>
      <COMPANY>Bram Van Tuyl Coldstore</COMPANY>
      <SHORT_NAME>VAN TUYL</SHORT_NAME>
      <STREET>Middelkampseweg 1</STREET>
    etc
    </IP_CUSTOMER_HEADER>
      </rfc:Z_XI_005_RFC>
    Receiver Grouping  payload
    <?xml version="1.0" encoding="UTF-8" ?>
    - <rfc:Z_XI_005_RFC xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    - <IP_CUSTOMER_HEADER>
      <CUSTOMERID>100853</CUSTOMERID>
      <COMPANY>Bram Van Tuyl Coldstore</COMPANY>
      <SHORT_NAME>VAN TUYL</SHORT_NAME>
      etc.
    With no conversion xml file is created on output directory 
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:MT_customer_header xmlns:ns1="http://avenue.com/xi/test"><customerid>100853</customerid><company>Bram Van Tuyl Coldstore</company> 
    etc
    Now trying to use File content conversion with the simplest possible conversion -- just insert a colon after all the fields in the structure.
    Following parameters
    Adapter type FILE
    receiver box checked
    Message protocol  File Content conversion
    File access etc as before
    Content conversion parameters
    Recordset :  IP_CUSTOMER_HEADER
    (have also tried Z_XI 005_RFC)
    Name
    CUSTOMERID.fieldSeparator  :        (colon)
    MONI shows message received by XI and processed correctly  but NO outfile gets written to the target directory.
    what am I doing wrong --it's probably something stupid.
    The data into XI is a ONE RECORD structure -- not a table etc.
    Cheers
    jimbo

    Hi guys -- both solutions STILL not working
    all I'm now getting is just a file with garbage in it
    Payload is fine on XI system
    Here's the payload
    <?xml version="1.0" encoding="UTF-8" ?>
    - <rfc:Z_XI_005_RFC xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    - <IP_CUSTOMER_HEADER>
    - <item>
      <CUSTOMERID>65013</CUSTOMERID>
      <COMPANY>OY PANDA AB</COMPANY>
      <SHORT_NAME>PANDA</SHORT_NAME>
      <STREET>P.O.Box 3</STREET>
      <STREET2 />
      <STREET3 />
      <STREET4 />
      <POSTCODE>3331 GT</POSTCODE>
       etc etc  until end of customer mmaster details
    </item>
      </IP_CUSTOMER_HEADER>
      </rfc:Z_XI_005_RFC>
    Without conversion file is generated on target directory
    Here's the XML output file  sent to the directory
    (for testing I only usec the ist 3 fields)
    Not sure why <item>   disappeared  - maybe that has something to do with it ?
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:MT_customer_header xmlns:ns1="http://avenue.com/xi/test">
      <CustomerId>65013</CustomerId>
      <company>OY PANDA AB</company>
      <shortname>PANDA</shortname>
      </ns1:MT_customer_header>
    RFC call from R3 system  is fine (otherwise I wouldn't get the message into XI. Transaction SM58 as well on R3 shows no RFC errors
    Converted file is just a blank with nl character at the end ??????
    cheers
    jimbo

  • How to read text file content in portal application?

    Hi,
    How do we read text file content in portal application?
    Can anyone forward the code to do do?
    Regards,
    Anagha

    Check the code below. This help you to know how to read the text file content line by line. You can display as you require.
    IUser user = WPUMFactory.getServiceUserFactory().getServiceUser("cmadmin_service");
    IResourceContext resourceContext = new ResourceContext(user);
    String filePath = "/documents/....";
    RID rid = RID.getRID(filePath);
    IResource resource = ResourceFactory.getInstance().getResource(rid,resourceContext);
    InputStream inputStream = resource.getContent().getInputStream();
    BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
    String line = reader.readLine();
    while(line!=null) {
          line = reader.readLine();
         //You can append in string buffer to get file content as string object//
    Regards,
    Yoga

  • Receive file content based on file Id/fileName

    Hi,
    I want to configure a scenario in XI that I can call via HTTP, pass the filename and receive the file conetnt of XML document.
    Suppose I had created two structres, 1st is fileID, and 2nd is FileContent.
    If i send the FileID/Filename, I should get File content based on FileId/Filename as output.
    If I am doing HTTP to RFC, for BAPI-Company getdetail,  I can fetch the data, based on the company ID, and can get company details as result,
    I am doing Http to file, Now how shd i proceed with my case.
    I send fileid/filename as input parameter, i shd get filecontent as output
    Regards,
    varun

    Hi Varun,
    i don't know how to do it in .Net
    But procedure must be the same as that of java.
    in java to develope web service we create a standalone EJB and expose it as a web service.
    you will have a variable that will contain the path of the file.
    then as return type take a variable of string type that will return the content of file.
    Down load the WSDL of your webservice from WebserviceNevigator of your WAS,
    Import it as a external defination in XI
    Do the Required Mapping.
    Thanks
    Sunil Singh

  • Add file contents using drag drop method

    I want to add file contents to a text view by drag drop method. How i can do that in cocoa using objective c? Can anybody help me. I am using following code in my appCotroller file to do the same but can't get the desired out put. Insted of getting file contents, i m getting the file URL (Path) in the text view.

    shaktirsg wrote:
    As you said i have to open that file in my performDragOperation function, I want to know where to write this function. bcoz i have written this function in my appCotroller class but that code does'n get executed. Can you help me on this.
    It is very hard to debug code I haven't seen. If you are getting the URL in your text view, you must be handling the drag operation correctly. Instead of putting the pasteboard data into the text view, get the file's contents and put that into the text view.
    Also can you give me a sample code on how to open files in coccoa, how to read the contents of that file?
    Look at NSString's "stringWithContentsOfFile:encoding:error:"

  • To get the content of a pdf file in a particular position in text format

    I am troubling with geting the content of a pdf file in a particular position.I got the code to get the content of a pdf document as whole in text format.But i only need the content at a particular area.
    i am using PDFTextStripper class in pdfBox jar to get the content as whole.
    pls send some sample code
    pls help me
    Edited by: thomas00 on Sep 21, 2007 2:55 AM
    Edited by: thomas00 on Sep 21, 2007 3:08 AM

    pls any one reply

  • How to get the content in embed swf file in Swf Loader on run time

    How to get the content in embed swf file in Swf Loader on run time
    [Bindable]
    [Embed(source="assets/index.swf")]
       private var SWFSRC:Class;
    <mx:SWFLoader id="_swfloader" source="{SWFSRC}" />

    Hi Flex harUI,
    Throw the error.
    Access of undefined property content

  • How to get the file content after uploading file

    Hello everyone!
    I have a question. Anyone can provide an example code by jsp that getting the uploaded file content after user uploading a file?
    Your help is highly appreciated!!!

    My experience is you need to do it twice: first read it to a StringBuffer and readline. Then write the file to server. See the code below
    MultipartParser parser = new MultipartParser(request, 10000000);
    Part part = null;
    FilePart filePart = null;
    File uploadDir = new File("/Uploads/");
    if (!uploadDir.exists()) {
    uploadDir.mkdir();
    while(true){
         part = parser.readNextPart();
         if(part == null)
              break;
         if(part instanceof FilePart){
              filePart = (FilePart)part;
              filename = filePart.getFilePath();
              //You can do one of the following option. Here is read line to a buffer and display to screen
    //if (filename != null) {
              //Do not store the file to server machine.
    //long size = filePart.writeTo(uploadDir);
    // System.out.println("The number of bytes written is "+size);
              reader = new BufferedReader(new InputStreamReader(filePart.getInputStream()));          
              String newline=reader.readLine();
              if(newline!=null)     {     
              reconcileContent.append("<table border=\"1\"><tr><th>Destination ID</th><th>File ID</th><th>Rept Date</th><th>As of Date</th><th

  • Spaces getting trimmed in file content conversion

    Hi all,
    I am converting a flat file to an XML file by XI. The problem which i am facing in file content conversion is that the spaces in flat file data are getting trimmed to one space in the XML in SXMB_MONI.
    The data in flat file is like SOUTHSEA and HANTS is having nearly 8 spaces.
    But the data in XML is:
    <b><u>SOUTHSEA HANTS PO5 2LZ PO5 2LZ020327</u></b> i.e. in XML, there is only 1 space between SOUTHSEA and HANTS.
    The following parameters i have used in file content conversion:
    .keyFieldValue '*'
    .fieldSeparator 'nl'
    .fieldNames RECORD_DATA
    .ignoreRecordsetName true
    I am taking each record of the flat-file in a single record RECORD_DATA in XML.
    <b>So can anyone tell me why the big spaces are getting trimmed to a single space eg. between SOUTHSEA and HANTS etc.</b>
    Thanks in advance.
    Rajeev Gupta

    Hi,
    try :
    NameA.fieldContentFormatting = <b>nothing </b>
    as the default is <b>trim </b>
    refere:
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    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>

  • Unable to get source file content as mail body in file to mail scenario

    Hi Friends,
    I am facing one problem with one of my file to mail scenario in PI(SP9).  I have done bypass scenario(without IR only with ID objects). Scenario is working fine, i am getting mail also.  But my requirement is i want complete source file content as a mail body (not xml format, text format).  I have checked all options, but configured scenario bydefault taking source content as a attachment and mail body is empty.  I have tested below options
    1. If i choose message protocol as FCC mechanism at source side content at target side i am getting xml format as a attachment( In mail adapter i have selected message protocol as xi payload, and without packate option on mail adapter). If i choose message protocol as xi all, i am getting 2 files as a attachment (one file as a payload content and second file as a source file content in xml format).
    2. If i choose message protocol as file at souce side that time i am getting source complete content as a attachment at target side in xml format, but mail attached file content is flat file(.xml extension) format. When i tried to open attachment file that time i am getting error in explorer, but i can see only one row in explorer  remaining rows unable to see.
    Please share your ideas on this.

    Hi,
    Follow below steps
    1. First basis level need to configure setup(SMTP) for mail.  After that only mail will go from SAP.
    2. Source side depending on requirement take communication channel(idoc, file etc)
    3. Receiver side communication channel take mail adapter and configure below setup
       3.1 select message protocol XI ALL/ XI PAYLOAD(WITH PACKAGE or WITHOUT PACKAGE)
       3.2 if message protocol is XI ALL, the complete content will be sent as a attachment along with payload file
       3.3 if message protocol is XI PAYLOAD, the source message, the source message will be sent as attachment.  Playload file filter automatically.
       3.4 If you use PACKAGE option on mail adaper, this time source strucute need to import from SAP (some standard structure only will be support, without strucutre we can't work).  If you choose package option no need to give mail id on communication channel, we need to pass mail id's from source structure.
    I hope now clear.

  • How to get the content of the uploaded file.

    Hi Experts,
    I am using a input box to get the path of the file to be uploaded.(I am not using FILE UPLOAD UI Element).Could you please let me know how to get the content of the uploaded file.
    Regards,
    Arun

    >
    ARUN KUMAR.S wrote:
    > Hi Experts,
    >
    > I am using a input box to get the path of the file to be uploaded.(I am not using FILE UPLOAD UI Element).Could you please let me know how to get the content of the uploaded file.
    >
    > Regards,
    > Arun
    You will not be able to use a normal InputField to upload file contents.  This is not allowed by the browser security model. You must use one of the upload specific UI mechanisms - the FileUpload UI element or as of 7.01 ACFUpDownload or FlashIslands.

  • HELP I have lost all my motion 4 content from all the files, ive looked in all the files and they are all empty. can i get replacement content as I my dvds where stolen along. with my other laptop.

    HELP I have lost all my motion 4 content from all the files, ive looked in all the files and they are all empty. can i get replacement content as I my dvds where stolen along. with my other laptop. any Ideas. would be a great help. For Motion 4.

    Try a hard reset:- hold the home button AND the power switch - ignore the red "Slide to power off" and wait ubntil the iPhone powers down, and then restarts - at the Apple logo, release all the buttons and see if your contacts reappear.

  • Get the content from the PDF file IN WD ABAP View

    Hi all,
    I have a offline interactive form with data filled in that and save in my desktop. I want to upload the PDF content ( data ) into Web dynpro view.
    Currently i have the view designed with all the input box bound with the respective fields in the context and these fields are same as Adobe form fields.
    I have a UI element to browse and pick the file from the desktop. I have the upload button to upload the data into it.
    When i click the upload button it goes for dump. " No Enough Information for processing or Output"
    *Get the content from the file
      WD_CONTEXT->GET_ATTRIBUTE( EXPORTING NAME = 'PDFSOURCE'  IMPORTING VALUE = CONTENT ).
    In the above statement CONTENT is initial.  Hence dump. I have take this source from SDN Blog.
    Kindly help me where i went wrong.
    Thanks in advance.I

    Hi,
    try my solution (reading dunamic table, but you can read any data from pdf xml) described here:
    Dynamic Table data cannot be Read.
    Regards Jiri

  • When I try to download and install iTunes I get this message...Temporary Internet Files\Content.IE5\iTuens64Setup(1).exe is not a valid Win32 application

    Temporary Internet Files\Content.IE5\itunes64Setup(1).exe is not a valid Win32 application

    That suggests that the installer is getting damaged during the download.
    I'd first try downloading an installer from the Apple website using a different web browser:
    http://www.apple.com/itunes/download/
    If you use Firefox instead of IE for the download (or vice versa), do you get a working installer?

  • BAPI_DOCUMENT_CHECKOUT... get binary file content???

    Hello!
    When i want to check out documents, the Function BAPI_DOCUMENT_CHECKOUT2 only checks the documents out in the unix file system of the server the dms is running. Is there another possibility to get the file content by a JAVA Application to story the file in the local filesystem?

    Hi Marco,
    I tried with the same thing as you mentioned, but its not working. see my code,
    DATA : T_ITAB TYPE SDOKCNTASCS.
    DATA : T_FILETYPE TYPE SDOKFILACIS.
    DATA: T_SKWF_IO LIKE SKWF_IO.
    T_SKWF_IO-OBJID = '44CEB4D549C229FBE100000097A3145C'.
    T_SKWF_IO-CLASS = 'CRM_P_ORD'.
    CALL METHOD CL_CRM_DOCUMENTS=>GET_WITH_TABLE
      EXPORTING
        PHIO                = T_SKWF_IO
        TEXT_AS_STREAM      = 'X'
      IMPORTING
        FILE_ACCESS_INFO    = T_FILETYPE
        file_content_ascii  = t_itab .
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    The table t_itab remains blank after executing the fun. module.
    Regards,
    Kumar.

Maybe you are looking for