[OpenLayers-Users] Format ajax.request

Heidt, Christopher M. CHRISTOPHER.M.HEIDT at saic.com
Wed Dec 3 11:58:20 EST 2008


Try using params instead of parameters and make your string an object
instead.

var queryStr = {
	request:'',
	version:'',
	service:'',
	typeName:''
}
 

-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
On Behalf Of Dan Koch
Sent: Wednesday, December 03, 2008 10:56 AM
To: users at openlayers.org
Subject: [OpenLayers-Users] Format ajax.request


Greetings,
I'm having trouble formatting my openlayers.ajax.request. I have the
following:

var queryStr =
'?request=GetFeature&version=1.0.0&service=wfs&typeName=massgis:GISDATA.
TOWNS_POLY';

sendTestRequest(queryStr);
	   
function sendTestRequest(queryStr) { 
	var uri =
"http://giswebservices.massgis.state.ma.us/geoserver/wfs";	
	var request = new OpenLayers.Ajax.Request(uri, 
		{method: 'get', 
		parameters:queryStr,
		contentType:'text/xml', 
		onComplete: function(){},
		onFailure: function(){alert("an error occured")}
		}
	);
} 

I get the following response via firebug:

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/ows
http://giswebservices.massgis.state.ma.us:80/geoserver/schemas/ows/1.0.0
/owsExceptionReport.xsd"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ows="http://www.opengis.net/ows">
  <ows:Exception exceptionCode="MissingParameterValue"
locator="request">
    <ows:ExceptionText>Could not determine geoserver request
      from http request
org.apache.catalina.connector.RequestFacade at d39fe</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>


Any help would be greatly appreciated,
Dan

-----
Dan Koch
Massachusetts Dept. of Fish & Game
--
View this message in context:
http://www.nabble.com/Format-ajax.request-tp20686966p20686966.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users



More information about the Users mailing list