Hello, everyone.
I am looking for a way to transfer large binary files (>100MB) both ways using a web service as a client in PB19R3. For example with the help of stream, see below the client code in C#. Is this a reasonable solution and how to rewrite it in PowerBuilder? Or is it better to use other methods? HttpCLient? RestClient? Right now it's written via OLE "xmlhttp.connecttonewobject("Msxml2.ServerXMLHTTP.6.0")".
Thank you for your answer or tips.
Code in C#:
using (FileStream fsSource = new FileStream(ulozitDokumentPozadavek.CestaKSouboru, FileMode.Open, FileAccess.Read))
{
var pozadavek = new Sluzba.Dms.Rozhrani.Funkce.UlozitDokumentStreamPozadavek();
pozadavek.KlicovaSlova = "Klíčová slova";
FileInfo fileInfo = new FileInfo(ulozitDokumentPozadavek.CestaKSouboru);
pozadavek.NazevSouboruSPriponou = fileInfo.FullName;
pozadavek.Stream = fsSource;
pozadavek.OsobaId = KlientSluzby.AktivniInstanceServeru.OsobaId;
pozadavek.Predmet = "Pokusný předmět";
pozadavek.SlozkaId = KlientSluzby.AktivniInstanceServeru.SlozkaId;
var odpoved = KlientSluzby.Sluzba.UlozitDokumentStream(pozadavek);
}
Test XML from SOAPUI:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header>
<tem:Velikost>39</tem:Velikost>
<tem:SlozkaId>17</tem:SlozkaId>
<tem:Predmet>Test</tem:Predmet>
<tem:OsobaId>2</tem:OsobaId>
<tem:NazevSouboruSPriponou>pokus.txt</tem:NazevSouboruSPriponou>
<tem:KlicovaSlova>Vesmir, Galaxie, Dalka</tem:KlicovaSlova>
</soapenv:Header>
<soapenv:Body>
<tem:UlozitDokumentStreamPozadavek>
<tem:Stream>cid:1235208661655</tem:Stream>
</tem:UlozitDokumentStreamPozadavek>
</soapenv:Body>
</soapenv:Envelope>