Streaming basics - reading large file from RESTful API

Hey all -
My command of PowerShell is pretty rudimentary, though I have written a number of scripts.  In a recent example, I was trying to redirect the output of my firm's RESTful API - a small .txt file - into a file, using | out-file <path and
file>.  THat worked 
just fine.  However, when I tried to do this with a docx or pdf file, the result was that I ended up with a small file that was 
unopenable.
I gather what I need to do is stream the content to a file, but I can't quite see how that is done in Powershell.  The files might  be
many MB in size and take upwards of 30 seconds to transfer.
Any basic guidance on how to approach this would be appreciated.  Thanks -
Paul
Paul

Oh so close!
I'm getting hung up on how to create and pass the session object itself. 
My first command,
Invoke-RestMethod -Uri
<apiKey>9588060291......</apiKey><email>...</email><password>...</password><endOtherSessions>T</endOtherSessions></createSession">https://test.lofco.com/v1/ILCGLServices/session?method=CREATE"&"client=DEV-TEST"&"xml=<createSession><apiKey>9588060291......</apiKey><email>...</email><password>...</password><endOtherSessions>T</endOtherSessions></createSession>
-SessionVariable s -Outfile 'c:\LofCo\Demos\API Code Samples\XML\Output\createsession_response.xml'
returns successfully; I can see in the output file the session ID. I was hoping this was captured in the variable s via the -SessionVariable approach, but when I run the second command:
Invoke-RestMethod -Uri
<acceptSplash>T</acceptSplash></workspaceEntryRequest">https://test.lofco.com/services/workspaces/entry?client=DEV-TEST"&"workspaceId=226691"&"method=CREATE"&"xml=<workspaceEntryRequest><acceptSplash>T</acceptSplash></workspaceEntryRequest>
-WebSession $s -Method Post -Outfile 'C:\LofCo\Demos\API Code Samples\XML\Output\enterexchange_response.xml'
I get a 403 error indicating the session has expired or is otherwise invalid. I'm clearly confused as to how to capture this session and pass it along...
Any pointers on that piece?  And thanks for your previous assistance.
Paul
Paul

Similar Messages

  • Reading large file with JCA Adapter in OSB

    Hello,
    We are searching for a solution how to read large file (>50M) from network drive and deliver it to queue via OSB 11gR4 (10.3.4). The problem is when reading the file with JCA File Adapter. It seems that it cannot handle as large files as we have. The documentation provides a way to bypass file size limitation by using Chunk Read but it seems to require BPEL Process execution which is not possible in our environment. Does anyone know if there are ways to implement this without having BPEL Process?
    Our usecase:
    read file from network drive -> transfer with OSB -> deliver MQ
    Other options than JCA File Adapter can be considered, if anyone can advice...

    If it's a plain routing use case and no message processing is required then you may simply use OSB's FILE transport instead of JCA adapter. Create a messaging type proxy service and select request message type as "binary". Also enable the content streaming (Disk buffer, compression).
    From OSB Dev guide -
    Oracle JCA Adapter for FTP and Files – Attachments (large payload support), pre- and post-processing of files, using a re-entrant valve for processing ZIP files, content streaming, and file chunked read are not supported with Oracle Service Bus.
    http://download.oracle.com/docs/cd/E17904_01/doc.1111/e15866/jca.htm#BABBICIA
    You may also refer -
    Reading huge flat file in OSB 11gR1
    Regards,
    Anuj

  • If you delete a large file from the mac hard drive does it also remove it from time machine on external hard drive

    if you delete a large file from the mac hard drive does it also delete it from time machine on the external hard drive ?

    As the others say, no, the backup copy won't be deleted immediately, but it will eventually.
    If you want to delete all backups of a selected item, such as for space or security reasons, see #12 in Time Machine - Frequently Asked Questions.

  • How do I move large files from a Windows computer to my MacBook Pro? There are a lot of photos (tiffs

    How do I move large files from a Windows computer to my MacBook Pro? There are a lot of photos (tiffs, jpgs, some photoshopped files), iTunes library, word docs. Is there a particular type of external hard drive that can be used or am I limited to copying stuff onto z-drive and moving that way?

    If both computers are on the same network, you can share the files from the Windows host using SMB and mount the share on the Mac. Otherwise, the Mac should be able to read (not necessarily write) any storage device formatted in Windows.

  • File Adapter Not Reading Large Files

    Dear Experts,
    Enviornment :-
    OS:-Linux
    Jdeveloper:- 11.1.1.6
    SOA:-11.1.1.6
    Weblogic:-10.3.6
    JDK:-SUN
    Allocated RAM:-16GB
    Currently we are in UAT Phase and now we are facingan  issue in reading large file.Below is the Design details of the service
    FileAdapter(Read)-->Bpel(Business login,Using FlowN)-->FileAdapter(Write CSV),JMS Adapter(AQ JMS topics)
    In this case at the time of read itself we are facing issue. File adapter reading xml file but in receive activity receives input data as
    xmlDocKey:1C135990067411E3BFA6B5087B629F9DI
    I really couldn;t understand about the error. Even i tried reading as Opaque format and still end up with same error.
    In order to make sure i have create mediator and tried reading the file, in case i was able to read file upto 15mb with out any error.Also i tried as  "read as Attachment" in Bpel component and able to read the attachment upto 7 mb file, but this is hitting the performance side.
    I request some one please let me know why the file adapter is giving XmlDOCKey rather then XMLContent to the inputvariable
    Regards,
    Tarak

    Can you check your BPEL Properties in EM?
    Go to Soa-infra > right Click > SOA Administration > BPEL properties
    increase the Dispatcher Engine Thread = 10, Dispatcher Invoke Threads = 60 and Dispatcher Engine Threads to 90
    Click on "More BPEL Configuration Properties"
    Increase the  DispatcherMaxRequestDepth from 600 to 1000.
    Bounce the server and see if works..
    Bounce the server and try again.
    If this fails, try get a threshold by increasing the file size until it fails again. 

  • Does SAP XI (PI 7.0) support streaming to support large file/Idoc

    Does SAP XI (PI 7.0) support streaming to support large file/Idoc/Message Structure transfers?

    AFAIK, that is possible with flat files, when you use File Content Conversion.
    Check this blog: /people/sravya.talanki2/blog/2005/11/29/night-mare-processing-huge-files-in-sap-xi
    Regards,
    Henrique.

  • Clients Time-Out When Retrieving Large Files  From Our PureFTPd Server

    Hi, not sure if this is the right place to get help, but didn't know where else to look. And let me begin by saying I'm not a server admin by trade, but that is the role I've fell into at a design firm. So please bear with my lack of knowledge on some of the more technical details.
    We have OS X Server 10.4.11 running here with PureFTPd installed and managed through PureFTPd Manager application. It has been fairly reliable for us for the last 2-3 years once the initial setup craziness was complete.
    But lately we've had 2 clients say that they've had difficulty downloading larger files from us. They get a time-out or error message on their end. They are most likely using Windows Explorer on a PC to do the transfer, which has always been the easiest method for our clients.
    One client had no problem getting files up to 14MB or so. But when trying to download a certain file that was about 80MB, it would not work. I tried different things here, and she tried multiple times, but no luck. I tried zipping the file to see if that would help, but no luck.
    Then another client had a similar problem today with a file that was only 25MB.
    We don't send large files very often, so I'm not sure if this is a recent thing or not. It seems like we've received some large files recently though.
    In PureFTPd manager, I usually leave all of the fields in the Transfers tab empty for all users. I didn't see anywhere else that would seem to impart a file-size limitation.
    • Any ideas at all?
    • If not, any other forums that I could search for help on? It looks like the developers site for PureFTPd Manager hasn't been updated in a year or two.
    Thanks in advance!

    Some years back I had trouble at a customer that had a ADSL using PPPoE connection to their ISP.
    Their router/modem (Speedtouch) couldn't cope with the LAN MTU when they sent files out so I had to lower it on their computers (running Panther?) ethernet interface from 1500 to 1492 (PPPoE overhead was 8 byte). The communication used to stall at about 25MB but the MTU change helped resolving that.
    My guess is that the router had to fragment (split in two) all outgoing packets it recived from the LAN computers and it just couldn't cope after a while.
    In your case it can be other network related things too like maybe needing traffic prioritizing, if receiving a lot of traffic from Internet and trying to send at the same time.

  • Transferring large files from my mac to pc

    Hi guys, i'm trying to transfer a large file from my mac to my pc. Its over 7GB and my mac doesnt have a DL dvd burner so that's out of the question. I've tried transferring it over the network however the eta is 2 days which is a little too long. I've tried putting the file on my external HD but when its formatted into mac os extended my laptop does not recognise it and when the drive is formated in ms dos (fat) i am unable to put the file on to the drive (error code 0)
    I've run out of ideas what to do so was hoping someone on here could help
    Thanks

    Hi and welcome to Discussions,
    have a look at this little Windows program http://hem.bredband.net/catacombae/hfsx.html
    It enables Windows to read from HFS-formatted (OSX) harddisks.
    Might be the easiest and cheapest solution, as others are not free.
    MacDrive would be another option, but is not free (but has more features).
    Regards
    Stefan

  • How to delete a READ ONLY file from Directory

    Hi Friends,
    how to delete a READ ONLY file from Directory , file is in my system only.
    Please help me .
    note: its read only file.
    Thank you.
    Karthik.

    hI,
    try with this statement.
    delete dataset <datasetname>.
    this will definitely work.
    Regards,
    Nagaraj

  • How to read the file from ftp server

    Hi
    I need to read a file from a ftp server . Iam using apache lib common-net .jar .
    FTPClient ftp = new FTPClient();
    ftp.connect(server);
    ftp.login(username,password);
    FTPFile[] files = ftp.listFiles();
    for(int i=0 ;i<files.length;i++){
    System.out.println(" File : "+ i + " - " + files);     
    InputStream ip = ftp.retrieveFileStream(path);
    I got the inputstream from the ftp server. but iam not able to read the contents of the file ....
    help me plzzzzz

    Hi
    I have one more problem . first i try to read the file and write the file in local directory . then i try to read the data in the remote file .. iam getting the datas as null.
    InputStream ip = ftp.retrieveFileStream(path);                    
    File f = new File("D:\\ftp.txt");                    
    FileOutputStream fo = new FileOutputStream(f);
    byte[] buf = new byte[1024];
    while ((len = ip.read(buf)) > 0) {                         
    fo.write(buf,0,len);               
    fo.close();
    BufferedReader br = new BufferedReader(new InputStreamReader(ip));
    String line;
    do {
    line = br.readLine();
    System.out.println(" data " +line);
    }while (line != null);

  • How to read .xls file from FTP server t oInternal table

    Hi
    am using the FTP_SERVER_TO_R3 to read xls file from FTP server to internal table
    but the data i get in LT_TEXT is special characters.
    CALL FUNCTION 'FTP_SERVER_TO_R3'
    EXPORTING
    handle = hdl
    fname = f_name "ProdDataFromCRM.xls.
    * CHARACTER_MODE = 'X'
    * IMPORTING
    * BLOB_LENGTH =
    TABLES
    BLOB = lt_text
    * TEXT = lt_text
    EXCEPTIONS
    TCPIP_ERROR = 1
    COMMAND_ERROR = 2
    DATA_ERROR = 3
    OTHERS = 4
    can any one help me out to get the exact data..
    Really appreciate your quick response..
    Thank You

    Hi, if you really retrieve an excel file, you can not see the data in ABAP. You may see them in Excel. For this you may use
    CALL METHOD document->open_document_from_table
    of the interface i_oi_document_proxy for OLE objects. You can access the data with reference to the interface i_oi_spreadsheet.
    Please check [Desktop Office Integration (BC-CI)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIOFFI/BCCIOFFI.pdf] for details.
    But, who knows, perhaps you want "And Now For Something Completely Different".
    Regards
    Clemens

  • Failed to read wsdl file from url

    Hi all,
    I am struggling with WL 9.2, consuming a WSRP enabled portlet at the following point:
    Having created a proxy portlet, refering to the WSDL of the WSRP producer, I did successfully deploy the portal. When accessing the portal and consuming the portlet the following exception is thrown:
    com.bea.wsrp.faults.TransportException: Failed to read wsdl file from url due to -- java.net.ConnectException: Tried all: '8' addresses, but could not connect over HTTP to server: 'www.w3.org', port: '80';
    The WSDL includes a schema (http://www.w3.org/2001/XMLSchema). The URL is definetely accessible by the server.
    I am open for any kind of support ;) Thanks in advance!
    Kind regards,
    Matthias

    Yes, they are all local schemas. The way ALSB works, even if the import path in the wsdl or parent schema doesn't exist, relative to the current directory, you can specify which schema resolves that reference. My WSDL imports several schemas, all of which import others. When I was done importing all the schemas and resolving references, all the references in WSDLs and XSDs were assigned and valid. However, after all of those imports and reference resolution, it still says the WSDL is invalid, with the following odd error message:
    The WSDL is not semantically valid: Failed to read wsdl file from url due to -- java.net.MalformedURLException: no protocol: /XMLSchema/PaymentServices/Resources/PaymentServices-200802.
    That path listed refers to one of the schemas imported by the WSDL. The reference to that schema in the WSDL was resolved, and it doesn't complain about that reference.

  • How to read the file from a folder.

    Hi All,
    How to read the file from a folder or directory from the non sap server / remote server.
    Regards
    Sathis

    open dataset filename for input in text mode
                         encoding default.
    filename is character type variable with the destination filename.
    Edited by: Jino Augustine on Apr 19, 2010 1:31 PM

  • How to read .mdb file from shared folder

    Hi All,
    In one of my local computer I have a shared folder and within the folder I have a .mdb file. Now I am trying to read that file from MII. I have tried with Get_File_List action block. I am providing the following information to Get_File_List
    Folder :
    <Computer Name>\<Shared Folder Name>
    Mask: .mdb
    But in return of Get_File_List, I am not getting any file related information. It is only providing like below
    <Rowsets>
    <Rowset>
    <Columns>
    <Column Description="Name" MaxRange="0" MinRange="0" Name="Name" SQLDataType="1" SourceColumn="Name"/>
    <Column Description="Date" MaxRange="0" MinRange="0" Name="Date" SQLDataType="93" SourceColumn="Date"/>
    <Column Description="Size" MaxRange="100" MinRange="0" Name="Size" SQLDataType="4" SourceColumn="Size"/>
    <Column Description="LastWriteDate" MaxRange="0" MinRange="0" Name="LastWriteDate" SQLDataType="93" SourceColumn="LastWriteDate"/>
    <Column Description="ReadOnly" MaxRange="1" MinRange="0" Name="ReadOnly" SQLDataType="4" SourceColumn="ReadOnly"/>
    <Column Description="FullPath" MaxRange="0" MinRange="0" Name="FullPath" SQLDataType="1" SourceColumn="FullPath"/>
    </Columns>
    </Rowset>
    </Rowsets>
    Can anybody suggest me how to achieve it.
    Thanks in advance
    Chandan

    Hi Chandan,
    Specify the mask as *.mdb and try.
    Thanks,
    Dipankar

  • Regarding Reading the file from Application Server

    Hi,
    I am trying to read data from Application Server but due to special characters it is getting dumped out.
    US24,Q,Acero (Carbon),AA,0010,0001,01,Ver Mir para dimension#
    US24,Q,Acero (Carbon),AA,0010,0002,01,Area rectificada sin da#os ra
    US24,Q,Acero (Carbon),AA,0010,0003,01,Ver Mir para dimension#
    US24,Q,Acero (Carbon),CD,0010,0001,01,ITPE Soken para verificacion
    US24,Q,Acero (Carbon),CD,0010,0010,01,No se permite desprendimiento
    US24,Q,Acero (Carbon),CD,0010,0002,01,"Vernier, cinta metrica"#
    In the last line it is going into dump due to special character ".
    Please suggest.
    Thanks
    Priyanka.

    Hi,
    You can check the mode in which you are reading the file
    from application server that is
    Open Dataset in Binary or Text Mode.
    Hope it helps
    Regards
    Mansi

Maybe you are looking for

  • Compare data record to session variable

    I am completely stumped. It should be easy. I am trying to compare a field from a database to a sesssion variable on a JSP page and even though the fields print out the same when I call them in JSP, my "If" statement never gets activated. Here's the

  • XML Comments in SOAP message - jax-rpc

    I ran across an issue with comments in my soap messages with regards to the serialization. My solution was to strip all the comments inbound and outbound. Are xml comments supported by JAX-RPC? I am currently scouring the internet for more informatio

  • How to send the email alert to some users (defined users hasn't post document to a library within a specified time frame)

    Hi, Native alert on a document library can setup to email to the predefined user when any changes on the document. However, I would like to setup a document library and alert me when [email protected] [email protected] [email protected] hasn't yet pu

  • HP Pavilion dv2000,microphone issue

    I change the OS of my HP Pavilion dv2000 from VISTA to Windows 7.At first everything found good.But when I start to use microphone on Yahoo Messenger it didn't work.I would like to know how i can make my microphone workable on Yahoo messenger and SKY

  • How can I deactivate snap in motion 2

    The snapping is driving me nuts. I turned the snap resolution up to 1px, but it's not helping much. Is there a modifier key perhaps?