Hello,
i'm writing a windows form application in delphi6. i need to call a method of a webservice to "upload" some binary files. So that i can call the method and upload 1 file, or 4 files, or X files (at a time)...
The webservice is written by me in asp.net 2.0 (C# on VS2008) so i can change it as i need.
In delphi, i've imported the wsdl, and automatically created the interface to the webservice... then, placed the HTTPRIO component to connect.
I've tested passing some "test" strings, and works.
Now, i need to pass the binary data, to the webservice.
if i send an "simple" array of byte, it works fine... i'm running on loal network, so it's very fast... but i have to send a "variable" number of files, so in the webmethod (C#) i've declared the parameter as a bi-dimensional byte array (byte[][]) and re-generated the delphi interface unit for it.
Delphi mapped the type as:
ArrayOfBase64Binary = array of TByteDynArray
I read the files and populate an array of TByteDynArray, each TByteDynArray contains a single file.
When i call the webmethod, passing the "ArrayOfBase64Binary" as parameter, it works... but there is a strange behaviour: if i send just a couple of kbytes (100kb) it takes really a lot of time! during this time, i have the delphi process at 100% of cpu, and no-packet ove the network... i tried to send just 1 megabyte, waited for 15 minutes, then i stopped it. trying with other size, it looks the time increasing exponentially...
So, i was trying to send them in a serialized (XML) structure... created the delphi class, with list of files, each file with its binary data, and then serialized it as XML and stored in a widestring... i've modified the webservice to read the string and deserialize it. But when i call the webmethod from delphi, i have this exception:
an invalid character was found in text content
i think it's a problem of delphi encoding, but i don't know how to solve it.
Anyone can help me, please?
Thanks a lot...
Andrea
i'm writing a windows form application in delphi6. i need to call a method of a webservice to "upload" some binary files. So that i can call the method and upload 1 file, or 4 files, or X files (at a time)...
The webservice is written by me in asp.net 2.0 (C# on VS2008) so i can change it as i need.
In delphi, i've imported the wsdl, and automatically created the interface to the webservice... then, placed the HTTPRIO component to connect.
I've tested passing some "test" strings, and works.
Now, i need to pass the binary data, to the webservice.
if i send an "simple" array of byte, it works fine... i'm running on loal network, so it's very fast... but i have to send a "variable" number of files, so in the webmethod (C#) i've declared the parameter as a bi-dimensional byte array (byte[][]) and re-generated the delphi interface unit for it.
Delphi mapped the type as:
ArrayOfBase64Binary = array of TByteDynArray
I read the files and populate an array of TByteDynArray, each TByteDynArray contains a single file.
When i call the webmethod, passing the "ArrayOfBase64Binary" as parameter, it works... but there is a strange behaviour: if i send just a couple of kbytes (100kb) it takes really a lot of time! during this time, i have the delphi process at 100% of cpu, and no-packet ove the network... i tried to send just 1 megabyte, waited for 15 minutes, then i stopped it. trying with other size, it looks the time increasing exponentially...
So, i was trying to send them in a serialized (XML) structure... created the delphi class, with list of files, each file with its binary data, and then serialized it as XML and stored in a widestring... i've modified the webservice to read the string and deserialize it. But when i call the webmethod from delphi, i have this exception:
an invalid character was found in text content
i think it's a problem of delphi encoding, but i don't know how to solve it.
Anyone can help me, please?
Thanks a lot...
Andrea