XML base64Binary value is out of range for 4GL type raw (118

Posted by Admin on 11-Feb-2010 10:36

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.

All Replies

Posted by Admin on 12-Feb-2010 09:52

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:

  1. Read image in chunks i.e. certain number of bytes at a time. I am reading 30 bytes at at time. These bytes are returned in a RAW data type (please see below for the code).
  2. Once I have the bytes I send these bytes to WEBSTREAM. On the client side user is given an option to save this file (the one being recieved through a web service) to a disk file.

/* 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

Posted by rstanciu on 15-Feb-2010 04:18

Why do you use a data-type RAW ?, this type is limited at 32ko.

You can use a OUTPUT MEMPTR.

This thread is closed