I have built an ABL Web Service Client that calls Web Service operations. The web service is written in .NET. One of the operations returns a byte array which is basically an image (.tif). The code generated by the WSDL Analyzer utility has given a RAW as a datatype to that operation for OUTPUTing the bytes.
When I call that operation I receive this error message:
XML base64Binary value is out of range for 4GL type raw (11852)
Your help is much appreciated.
Thanks so much.
I have solved the issue and thought I should paste my code to help others getting stuck at this streaming issue.
My requirements were to read an image through webservice and display it on the browser. So in order to implement this I performed the following:
/* Procedure invocation of OperationName . */
RUN OperationName IN hPortType(INPUT aConnectionHandle, INPUT fileHandle, INPUT chunkSize, OUTPUT RawDataTypeResult).
/* Receiving rest of the bytes in a LOOP */
DO WHILE LENGTH(RawDataTypeResult) NE ?:
/* Sends stream to WEB Browser */
PUT {&WEBSTREAM} CONTROL RawDataTypeResult.
/* Calling Web Service Operation */
RUN OperationName IN hPortType(INPUT aConnectionHandle, INPUT fileHandle, INPUT chunkSize, OUTPUT RawDataTypeResult).
END.
The above code is sending the bytes being read to Web Browser through WEBSTREAM.
NOTE: If you are getting the error message discussed in my very first discussion, it is because the RAW type that you are using is not able to hold the number of bytes returned from the Web Service operation. How to solve this: Decrease the chunk size (i.e. the number of bytes to be read) and try again.
Hope this would help others with Image Streaming issue.
: ) <
Jatinder
Why do you use a data-type RAW ?, this type is limited at 32ko.
You can use a OUTPUT MEMPTR.