S
simplicity
I need to upload the local file to the server site in the environment
where there is no webserver running there, hence no POST method is
available. All I have at the receiving end is the SOAP server which
means that I must send the file as the SOAP message containing textual
representation of bytes, for example:
fileContent = "a b<LF>" must be sent as <data>613262320A</data> where
61 is a hex value of 'a', 32 of SPACE, 62 is 'b', 0A is LF etc
I tried replace() but I am running into a problem of premature end of
array - replace() deals with String types and will do the conversion
to something like "a%32b%0A" (which can be further processed easily to
convert all typable characters by their hex values while stripping %
from non-typable ones) but it will quit on the first accurence of 00
(null) byte and, no need to mention, the binary file will be full of
those.
I can step through the fileContent array one byte at a time and
traverse "special bytes" including null (byte value 0x00) up to the
length of the file I read but I do not know how to determine what
exactly the non-typable characters are, that is I can do mapping
if (content == 'a') concatenate "61" to the SOAP message
but I don't know how I can deal with something like <BEL> character
(byte value 0x07) or any byte value above 0x7F.
Is there a way out of this?
where there is no webserver running there, hence no POST method is
available. All I have at the receiving end is the SOAP server which
means that I must send the file as the SOAP message containing textual
representation of bytes, for example:
fileContent = "a b<LF>" must be sent as <data>613262320A</data> where
61 is a hex value of 'a', 32 of SPACE, 62 is 'b', 0A is LF etc
I tried replace() but I am running into a problem of premature end of
array - replace() deals with String types and will do the conversion
to something like "a%32b%0A" (which can be further processed easily to
convert all typable characters by their hex values while stripping %
from non-typable ones) but it will quit on the first accurence of 00
(null) byte and, no need to mention, the binary file will be full of
those.
I can step through the fileContent array one byte at a time and
traverse "special bytes" including null (byte value 0x00) up to the
length of the file I read but I do not know how to determine what
exactly the non-typable characters are, that is I can do mapping
if (content == 'a') concatenate "61" to the SOAP message
but I don't know how I can deal with something like <BEL> character
(byte value 0x07) or any byte value above 0x7F.
Is there a way out of this?