How to download a file via web service in Windows Phone 8.1?

My project just got 2 part.
1.Pivot app
2.Webclient server (provide data for pivot app the view the data)
My concert that how do i do a download button to download a file via web services in to isolated storage.
urgent!

something like this:
public async System.Threading.Tasks.Task DownloadFile()
using (var client = new Windows.Web.Http.HttpClient())
var stream = await client.GetInputStreamAsync(new System.Uri("http://urltomyfile"));
var file = await ApplicationData.Current.LocalFolder.CreateFileAsync("myfile.txt", CreationCollisionOption.GenerateUniqueName);
using (var fileStream = await file.OpenAsync(FileAccessMode.ReadWrite))
IBuffer buffer = new Windows.Storage.Streams.Buffer(1024);
while ((buffer = await stream.ReadAsync(buffer, buffer.Capacity, InputStreamOptions.None)).Length > 0)
await fileStream.WriteAsync(buffer);
await fileStream.FlushAsync();
how is your webservices offering the file?
Microsoft Certified Solutions Developer - Windows Store Apps Using C#

Similar Messages

  • Down-/Upload files via Web Services using a NON-SAP system!?

    Hello,
    is it possible to down-/upload files via web services using a NON-SAP system!?
    Regards,
    Jens

    Hi Jens,
    I am not sure about your requirement here. What i could understand is that you want to check whether service could handle file processing?
    1) Uploading file - You can build a Webservice which has import/export parameters as the file structures and implement the proxy class in such a way that the passed data is written to application server.
    2) Downloading file - Same as uploading file, but the proxy class would have the code to extract data from the application server and pass them as output parameter.
    Functionality of Non SAP system: The system which calls these services should be able to convert the output of proxy data into file in case of downloading the file and it should be able to convert the file data into export parameters in case of uploading file.
    Hope this helps.
    Regards,
    Prasanna

  • How to insert pdf file to adobe reader in windows phone 8? which directory?

    How to insert pdf file to adobe reader in windows phone 8? which directory?

    An other way is to copy the pdf with Windows explorer into the path /documents of the phone. Open Office and choose Adobe Reader. The pdf will be copyed in the Sandbox of the Reader and You may read it. You may delete the PDF in the documents path. It will still be in the Readers sandbox. All without any cloud ;-)!

  • How to start a process via web service with automatically run first screen

    Hi guys,
    we want to start the process via web service and skip the inbox presentation of the first human activity of the process. It means that the first activity should start automatically by clicking the link (wsdl link).
    Is there any opportunity to realize this thought?
    THX
    Regrads
    Phil

    Hi Phil,
    You may refer to my blog series for steop by step procedure on how to initiate a BPM workflow through webservice. Below are the links:
    /people/arafat.farooqui/blog/2009/08/13/introduction-to-sap-netweaver-bpm-part-4
    /people/arafat.farooqui/blog/2010/06/23/introduction-to-sap-netweaver-bpm-part-5
    Hope this helps!!
    Regards,
    Arafat

  • How could I synchronize databases via web services

    I have two web sites. The first has been build in jsp. The second has been build in php. Each of these sites has database mysql.
    I have managed to communicate these two web sites via web services.
    I would like someone to tell me how could I syncronize these two databases via web services. There is something specific procedure?
    Thanks in advance, sorry for my bad English

    If you can explain us what you actually looking for, then I can extend my help.As we are also using websites in jsp which is having DB connections.
    Cheers
    Rajesh R

  • How to Download a file from web server using servlets

    how do we download a file from Java Web Server connecting to oracle database
    it should start as soon a i click a button in my html browser
    please reply as it is needed to complete my project to submited to the collage

    With SQLJ you can do it.
    When you look at:
    http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/basic/basic.htm
    or
    http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/advanced.htm
    There are samples for reading LONGRAW / BLOB from Database. If you want use it in servlet you have to pass the result to the responce object, set the correct mime-type and set the response.setContentLength( xx). This is for some PlugIns nessessary (pdf).
    regards Dietmar

  • How to send large files using web service

    hello everyone,
    I am new to this forum, so please pardon me if I post some silly problem...
    I have created one service which sends file when client (jsp) request it. I am using JBOSS as my server. purpose of this application is when client request some fle then service will send this file... and most of the time we need to send only pdfs and ppts...
    Problem is, this service sends txt, java files easily of any size but when i tried sending PDF, PPT then i got xml.SAXParseException.......
    I thought this error is because of some characters, but how to fix it....
    I am working on Linux.
    code snippet is:
    import java.io.*;
    public class MyHelloService
    public String file_size (String name)
         String s = new String("");
    byte[] sendata1=new byte[100];
         try
              System.out.println("name recived is :::::::::::"+name);
              FileInputStream in=new FileInputStream(name);
              int size=0;
              size=in.available();
              System.out.println("FILE SIZE IS:::::"+size);
              byte[] sendata11=new byte[size];
              i=in.read(sendata11);
              System.out.println(new String(sendata11));
              s=new String(sendata11);
         catch(Exception e)
                   System.out.println("EXCEPTION IN JWS:::"+e);
                   s=new String("nofilefounderror");
         return s;
    pls tell me what am i doing wrong ad how to fix this?
    and one more thing can i send byte array from a web service as i tried but couldnt do that... so i am reading everything in a single byte array and then converted to string.....
    is it possibel to send file in a chunk?if yes, how to do that?
    waiting for the reply..... pls reply as soon as possible....
    Rashi

    hi,
    I am sending file from server to client i.e client will request for a file and service will send it back....... no socket connection is there...I am using JBOSS and apache axis.
    pls help me out.....
    Rashi

  • Generating file via web service and store it on client's hard disc

    Hello!
    First of all I want to see that i am a beginner concerning Web Dynpro.
    In the last weeks I made a lot of steps but now i am stuck with a problem, i didn't find a helpful solution for.
    I want to create a  textfile dynamically via web serivce. That works fine.
    Now I am looking for a solution  to write this file on client hd.
    Is there a possibility to use simply the Java "File" class and give the path name or do I have to use the wd download ui?
    For the downloadUI I only found examples concerning Files in MIME but i don't know what to do if my file is dynamically created during runtime and not stored on any hard disc.
    I would be grateful if you could get me some hints to find the right way.

    Hi
    FileDownload UI is what you should be using!
    Bind the 'resource' property of the FileDownload UI element to a context attribute (say with name SomeFile) of type
    com.sap.ide.webdynpro.uielementdefinitions.Resource
    in local dictionary. Insert the following piece of code where the file content is dynamically being generated.
    Byte[] dynamicFileConent = yourFileContentGenerateMethod(); // your logic
    IWDResource resource =
             WDResourceFactory.createResource(dynamicFileConent ,"FILE_NAME.TXT",WDWebResourceType.UNKNOWN);
    wdContext.currentContextElement().setSomeFile(resource); // SomeFile is the name of the Context Attribute
    Regards
    kk
    Edited by: kaushal kishore on Mar 16, 2010 6:45 PM

  • How to save pdf files to skydrive/PC on Windows Phone 7.8?

    I cannot save my pdf files to skydrive or PC on my Nokia Lumia 800 which runs on Windows Phone 7.8. I mean there is no option provided by Adobe on WP 7.8, to save/have a backup of pdf files. When is Adobe going to provide this most important feature to WP 7.8 users?

    Thanks for the suggestion my dear friend. But, Apitron PDF Viewer is compatible with Windows Phone 8 phones. Mine is Windows Phone 7.8 (Nokia Lumia 800 phone)

  • Uploading a File via Web Services

    We can't seem to find a way to upload a file without needing
    to POST it to a specific page on the web server. On top of that, it
    apparently also creates a new session in Asp.NET when we do the
    post. How do you guys work around this issue?

    I have solved the problem - for future references or for anybody else having the same problem read below:
    The JavaDoc for HttpOutputStream states the following:
    "There are two constructors for this class, one taking a length parameter, and one without any parameters. If the stream is created with a length then the request will be sent with the corresponding Content-length header and anything written to the stream will be written on the socket immediately. This is the preferred way. If the stream is created without a length then one of two things will happen: if, at the time of the request, the server is known to understand HTTP/1.1 then each write() will send the data immediately using the chunked encoding. If, however, either the server version is unknown (because this is first request to that server) or the server only understands HTTP/1.0 then all data will be written to a buffer first, and only when the stream is closed will the request be sent."
    Constructing the HttpOutputStream with the size of the content to upload solved the problem. I guess the HTTP version was unknown or Oracle only understands HTTP/1.0 (anybody that can clear this up?), causing everything to be buffered (in memory) only to be send when the streams was closed, which in the case of a big file caused OutOfMemeryError.

  • How to download a file from Web-URL to local HD

    Hy,
    I am trying to download a picture from a specific URL such as
    "http://ia.imdb.com/media/imdb/01/I/66/16/02m.jpg"
    to my local HD, but I only have experience in downloading text based files, such as HTML using the BufferedReader method and a URL object to read the text based HTML file and PrintWriter to write the file on my HD. I have a hard time finding a good tutorial on this, so I would be more than happy to get any help from you guys, the cherry on the cake would of course be a code sample for demonstration...
    Please!

    Use BufferedOutputStream and BufferedInputStream rather than
    BufferedReader and BufferedWriter.
    Should be the same otherwise.

  • Trasport file by web services

    hi sdn boys
    i have a problem.
    i have a abap program that trasfer a file to server, than this file is put on a web page.
    now i must download the file using web services.
    it 's possible and How can I do?
    thanks

    Hello everyone.
    I have the same problem like it is described in the first post.
    I create a Web Service and also in WSADIMN my Service doesn’t appear.
    When I go to WSCONFIG it is not possible for me to save the created (press F5) Web Service. It seems that it is not possible for me to save in the whole system. Doesn’t matter what I do, the save button is disabled.
    I extend my license and I specify as user “student” and not “developer”. Could that be the problem?
    Anyone an Idea
    Thx a lot

  • Download a XML file from Web Services Using Flex

    Hi All...
    I am new for flex, im developing a windows application using Flex/Air, i have connected the web services with user authentication, now I want to download a xml file using web services in flex,
    how can i do this?? please reply...
    Thanks in advance
    Vasanth

    Hi All....
    I have done this myself using sample tutorials...
    here is the code for your reference guys
              plyLoginName = txtEmailIdDownload.text;                
                     var urlpath:String = new String("your url p?LoginName=");
                    urlpath = new String(urlpath.concat(plyLoginName));
                    urlpath = new String(urlpath.concat("&PlayerType="));
                    urlpath = new String(urlpath.concat(chkseasonvalue));
                    Alert.show(urlpath);
                var request:URLRequest = new URLRequest(urlpath)
                var fileRef:FileReference = new FileReference();           
                fileRef.download(request,"yourfilename.xml");
                Alert.show('File downloaded Successfully');   
                 txtEmailIdDownload.text = "";
                txtPWDownload.text = "";
    thanks
    Vasanth

  • How to integrate Oracle BI Publisher via Web Services in Oracle Forms.

    hi
    I hope you fine and happy. I think you hear about the new reporting tool (Oracle BI Publisher).
    Really it is a great tool. I need someone help me; How I can integrate Oracle BI Publisher via Web Services in Oracle Forms.
    I got the guidelines of this integration process from ORACLE.
    But, when I compile the script of publicreportserviceclient.callRunReport - the script running the report -, I get some errors in PL/SQL compiler
    http://www.oracle.com/technology/products/xml-publisher/index.html

    ==========================
    PL/SQL CODE:
    ==========================
    DECLARE
         RAISEDEXCEPTION ORA_JAVA.JOBJECT;
    REPORT_PATH VARCHAR2(200);
    PARAM_NAME VARCHAR2(200);
    PARAM_VALUE VARCHAR2(200);
    UN VARCHAR2(200);
    PW VARCHAR2(200);
    FORMAT VARCHAR2(200);
    TEMPLATE VARCHAR2(200);
    OUT_FILE VARCHAR2(200);
    OBJ ORA_JAVA.JOBJECT;
    BEGIN
    OBJ := PUBLICREPORTSERVICECLIENT.NEW();
    REPORT_PATH := '/LEARN/EMPLOYEES/EMPLOYEES.XDO';
    PARAM_NAME := 'P_DEPTNO';
    PARAM_VALUE := '50';
    UN := 'Administrator';
    PW := 'Administrator';
    FORMAT := 'PDF';
    TEMPLATE := 'Simple';
    OUT_FILE := 'C:\DevSuiteHome_1\j2ee\home\default-web-app\' || 'TEST';
    --PUBLICREPORTSERVICECLIENT.CALLRUNREPORT(OBJ,:REPORT_PATH,PARAM_NAME,:PARAM_VALUE,UN,PW,:FORMAT,:TEMPLATE,OUT_FILE);
    PublicReportServiceClient.callRunReport( REPORT_PATH,
    PARAM_NAME,
    PARAM_VALUE,
    UN,
    PW,
    FORMAT,
    TEMPLATE,
    OUT_FILE);
    WEB.SHOW_DOCUMENT('HTTP://127.0.0.1:8889/j2ee/' || 'TEST');
    END;
    ==========================
    JAVA CODE FOR callRunReport FUNCTION:
    ==========================
    public void callRunReport (String reportPath, String[] paramName, String[] paramValue, String
    username, String password, String format, String template, String outFile)
    try {
    bip_webservice.proxy.PublicReportServiceClient myPort =
    new bip_webservice.proxy.PublicReportServiceClient();
    // Calling runReport
    ReportRequest repRequest = new ReportRequest();
    repRequest.setReportAbsolutePath(reportPath);
    repRequest.setAttributeTemplate(template);
    repRequest.setAttributeFormat(format);
    repRequest.setAttributeLocale("en-US");
    repRequest.setSizeOfDataChunkDownload(-1);
    if (paramName != null)
    ParamNameValue[] paramNameValue = new ParamNameValue[paramName.length];
    String[] values = null;
    for (int i=0; i<paramName.length; i++)
    paramNameValue[i] = new ParamNameValue();
    paramNameValue.setName(paramName[i]);
    values = new String[1];
    values[0] = paramValue[i];
    paramNameValue[i].setValues(values);
    repRequest.setParameterNameValues(paramNameValue);
    else
    repRequest.setParameterNameValues(null);
    ReportResponse repResponse = new ReportResponse();
    repResponse = myPort.runReport(repRequest,username,password);
    byte[] baReport = repResponse.getReportBytes();
    FileOutputStream fio = new FileOutputStream(outFile);
    fio.write(baReport);
    fio.close();
    } catch (Exception ex) {
    ex.printStackTrace();

  • How to create a proxy to retrieve the xml file from web services

    Hi Every one,
    We have a requirment where we receive a xml file from Kenexa, a third party HR tool using a middleware tool. from SAP side We have to create a proxy to retrieve the xml  file from web services by initiating call through middleware tool i used earlier.
    these are the steps i intend to follow to accomlish the requirement.  
    1) middleware tool has to initiate the call to kenexa web services to  receive the xml file when it is available.
    2) On SAP we need to create a ABAP Proxy service provider to middleware where this file can be received.
    Can any one guide me how i can create a proxy to retrieve the xml  file from web services by initiating call through other middlewre (its not PI). 
    Any help would be really great, i am not a ABAP developer, so please help me with this. Thanks.

    Thank for reply.
    The computers are in different locations, but yes it's possible, the users in this enviroment are all local administrator of the machines, and we can distribute the script centrally from the DC automatically
    Acrobat use Java, right? I'm not so expert in java, but something about it could not be so difficult to manage.
    Do you know some place where i can get some info about JS and acrobat?

Maybe you are looking for

  • My $20 iTunes card has no code to redeem with only a card number what do I do

    My $20 ITunes card has no code under scratch off label what do I do?

  • Power saver and Toshiba utilities on Satellite A10 dont work properly

    hello i download the latest version of power saver, because i reinstalled my satellite A10 under windows xp, toshiba console and when i click on energy saver i have a error and the program don't run. can you help me ? [email protected] thanks

  • Networking with Ubuntu

    Hi, I wish to network my iMac G5 with my old PC running Ubuntu Linux (dapper drake). Can anyone help me set up file sharing and sharing the same printer?

  • Javahelp and indexer

    Hi java coders, I'm trying to apply search system to my application that uses JavaHelp. My probleme is that I don't know how to use indexer. Can someone help me ?? plz ! (some lines of code ?) MSasha.

  • External DVD player refuses to read DVDs

    I've searched high and low on the internet and I can't find any solutions to this problem or anyone with this exact same problem. Yesterday I bought a region 2 internal DVD player (LG GH22LP20) as well as a USB enclosure (my Macbook Pro is set to reg