Hello,
To send a request XML to the server wms, I use xmlhttprequest, but in answer
I obtain strange carractères in the place of the image like this(in reponse
firebug):
File XML is the file of demonstration on geoserver and the test of this file
with TestWfsPost functions perfectly.
The response of Xmlhttprequest is a file text or xml. How can one recover an
image in the answer
here my code and after the special carractères
code html+javascript:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content="PSPad editor, www.pspad.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8 " />
<title></title>
<script language="JavaScript">
var XML=state_wms();
function state_wms()
{
var XML;
XML = '<?xml version="1.0" encoding="UTF-8"?>'+"\n";
XML += '<ogc:GetMap'+"\n";
XML += ' xmlns:ogc="http://www.opengis.net/ows"'\+"\\n";
XML += ' xmlns:gml="http://www.opengis.net/gml"'\+"\\n";
XML += ' version="1.1.1" service="WMS">'+"\n";
XML += ' <StyledLayerDescriptor version="1.0.0">'+"\n";
XML += ' <NamedLayer>'+"\n";
XML += ' <Name>topp:states</Name>'+"\n";
XML += ' <NamedStyle>'+"\n";
XML += ' <Name>population</Name>'+"\n";
XML += ' </NamedStyle>'+"\n";
XML += ' </NamedLayer>'+"\n";
XML += ' </StyledLayerDescriptor>'+"\n";
XML += ' <BoundingBox
srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">'\+"\\n";
XML += ' <gml:coord>'+"\n";
XML += ' <gml:X>-130.0</gml:X>'+"\n";
XML += ' <gml:Y>24.0</gml:Y>'+"\n";
XML += ' </gml:coord>'+"\n";
XML += ' <gml:coord>'+"\n";
XML += ' <gml:X>-66.0</gml:X>'+"\n";
XML += ' <gml:Y>50.0</gml:Y>'+"\n";
XML += ' </gml:coord>'+"\n";
XML += ' </BoundingBox>'+"\n";
XML += ' <Output><Format>image/png</Format>'+"\n";
XML += ' <Size>'+"\n";
XML += ' <Width>600</Width>'+"\n";
XML += ' <Height>320</Height>'+"\n";
XML += ' </Size>'+"\n";
XML += ' </Output>'+"\n";
XML += ' <Exceptions>application/vnd.ogc.se+inimage</Exceptions>'+"\n";
XML += ' </ogc:GetMap>'+"\n";
return XML;
}
// Send the request
function testPost()
{
var xmlhttp = new XMLHttpRequest();
xmlhttp.open ("POST", "http://127.0.0.1:8080/geoserver/wms",true\);
xmlhttp.setRequestHeader('Content-Type', 'application/vnd.ogc.wms_xml');
alert(XML);
xmlhttp.send(XML);
}
</script>
</head>
<body>
<td><input type="button" onclick="testPost()" value="Testpost">
</body>
</html>
And Strange carractere in reponse but not image:
"PNG
IHDR�� ��{���eN������IDATx��at��yǛ{�z���8j㞸���$�[�i�$MҺ7n���<jYrb[��)[
��ĽE�{����A�� �
�p��T����)��G"
|�������>�e�����������������������������������������������������������������������
�6�b��̴�� ������ n2�͟�Hp������
Thank you
--
View this message in context: http://www.nabble.com/Getmap-with-Http-Post-do-not-go-tf4421060.html#a12610269
Sent from the GeoServer - User mailing list archive at Nabble.com.