[Requests] CR: SOAP GetTile response example with CDATA (07-057r6)

Joan Maso joan.maso at uab.es
Thu Mar 12 06:13:57 EDT 2009


1. Evaluator:
        Joan Masó

2. Submission: [OpenGIS Project Document Number, Name]
        07-057r6 Candidate OpenGIS Web Map Tiling Service Implementation 


1. Requirement: [General, #]

2. Implementation Specification Section number: [General, #]
       9.2.2  GetTile request SOAP encoding response
       SOAP example response file.

3. Criticality: [Major, Minor, Editorial, etc.]

4. Comments/justifications for changes: [Comments]
I require to use a CDATA for base64 encapsulation image.

    Base 64 encoded data...

Sinse "a CDATA section is used to escape a block of text that
would otherwise be parsed as markup" I'm suggesting to change the current
encoding of a SOAP GetTile response. Advantages:

-         Better support in javascript.
-         Fast parsing since XML parsers will know that all this data hasn't
to be parsed. Do not forget that XML part of the message is minimum compared
to the base 64 huge data (even for a small 256x256 png image it could be

I have tested support to SOAP encoding on our JavaScript WMTS-WMS client.

I discovered that a recent addition to HTML allows support for embedded
base64 data on ad image in a very simple way:

alt="Base64 encoded image" width="150" height="150"/>


This method is supported for all browsers except the current version of
Internet Explorer (but is expected to be supported in the new version 8).

We have just implemented the following method

- Write a SOAP GetTile request and send an AJAX POST.
- Receive the response and parse it with XML DOM
- Change and image "src" than previously exists with the new data received.
Fortunately we include the MIME type on the response so I have all the
elements to build a long string to do that.

BUT I find out that the image is only shown partially!!. I have just found a
XML DOC implementation limitation:

"The DOM does not define a size limit for the DOMString type, however some
implementations do:

Firefox: 4K (4096 bytes)
Opera 9.0: 32K (32768 bytes)
Safari 3 64K (65536 bytes)"


And for tha reason, XML DOM only gives to me the first part of the image.

Some solutions are discussed here:


But I found a simpler solution:

To use:

    Base 64 encoded data...

And it work! Now we have a SOAP client implementation in JavaScript!. Tested
in FireFox, Opera, Safari and Chrome.

Joan Masó

More information about the Requests mailing list