Android Question yet another question on WebService (SOAP)

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
hello

i'm consuming a web service using SOAP
i do it using xml
it works like charm

but now i need to use a bytesarray as a parameter
since the entire XML is string there is no way i can add the bytesarray element as it cannot be added to string
the following is a sample code illustrating the problem
Prm1,prm2,prm3 are strings
PrmX is the bytesarray

can anyone assist on this?
or offer an alternate direction?

Thanks

XML = _
"<?xml version='1.0' encoding='utf-8'?>" & _
"<soap12:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap12='http://www.w3.org/2003/05/soap-envelope'>" & _
"<soap12:Body>" & _
"<FuncName xmlns='https://Webservice.com/'>" & _
"<prm1>" & String1 & "</prm1>" & _
"<prm2>" & String2 & "</prm2>" & _
"<prm3>" & String3 & "</prm3>" & _
"<PrmX>" & BytesArray & "</PrmX>" & _
"</FuncName>" & _
"</soap12:Body>" & _
"</soap12:Envelope>"
 

Jmu5667

Well-Known Member
Licensed User
Longtime User
You could maybe convert your byte array to a hex encoded string for PrmX ?

B4X:
Dim bc As ByteConverter
Dim ecbHex As String = bc.HexFromBytes(BytesArray )
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
You could maybe convert your byte array to a hex encoded string for PrmX ?

B4X:
Dim bc As ByteConverter
Dim ecbHex As String = bc.HexFromBytes(BytesArray )
sorry, not working as the webservice expects bytes array not string
i don't get error but the parameter does not construct binary element
so when the ws gets it it becomes "garbage"
i can't modify the ws as it is a live one and in use when others are sending bytesarray from pc apps
now i wanted to use it from b4a
 
Upvote 0
Top