我正在尝试在postforEntity请求的主体内发送XML,这样我就可以通过url请求查询xml,但是收到此错误
Invalid mime type "text/xml; subtype=gml/2.1.2": Invalid token character '/' in token "gml/2.1.2"
这是我的resttemplate: List coords = new ArrayList();
@RequestMapping(value = "/postCoord", method = RequestMethod.POST)
public Response postCoord(@RequestBody Coords coord) {
coords.add(coord);
RestTemplate restTemplate = new RestTemplate();
String XML =<wfs:GetFeature xmlns:xsi=\"http://..... </wfs:GetFeature>
ResponseEntity<String> coords = restTemplate.postForEntity(
"http://localhost:9095/geoserver/topp/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=text/xml&TRANSPARENT=true&QUERY_LAYERS=topp:states&STYLES&LAYERS=topp:states&INFO_FORMAT=gml:2.1.2&FEATURE_COUNT=50&X=50&Y=50&SRS=EPSG:4326&WIDTH=101&HEIGHT=101&BBOX=-129,24,-63,50&Content-Type=application/xml",XML,String.class);
// Create Response Object
Response response = new Response("Done", coords);
return response;
这是geoserver中的USA Population地图,iam试图找到xml文件中的点在url请求中给出的bbox中的位置