[OpenLayers-Users] WFS called with xmlhttprequest in different
domain
JuKiM
rifins at gmail.com
Tue Dec 1 10:03:04 EST 2009
Hi,
I have a web app served by IIS that calls WFS in geoserver. I've read that a
proxy is needed to do this, but everything that I'm finding is for Apache..
To resolve this, I create a page called test.aspx that acts as a ProxyHost
(test.aspx?url=) which is called and loads the URL passed as querystring.
This works with GET and POST, but my problem is that when the result is
returned to the client, after the XML there are the html tags appended.
To call the GeoServer WFS I do the next code in test.aspx.vb:
Dim wsResponse As XmlDocument = New XmlDocument()
Dim url As String = Request.QueryString("url")
wsResponse.Load(url)
Dim XMLDocument As String = wsResponse.InnerXml
Response.Clear()
Response.ContentType = "text/xml"
Response.Write(XMLDocument)
And the result in client side is:
<?xml version="1.0" encoding="UTF-8"?><wfs:FeatureCollection> [...]
</wfs:FeatureCollection>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
</title></head>
<body>
<form name="form1" method="post"
action="test.aspx?url=http%3a%2f%2flocalhost%3a8080%2fgeoserver%2fwfs"
id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwCHFbQDoeTY2CHFbQDoCHFbQDoedgOjCHFbQDoeOGKuXA9" />
</div>
<div>
</div>
</form>
</body>
</html>
Is there any way to avoid the adding of html tags and return only the XML?
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091201/369a91fd/attachment.html
More information about the Users
mailing list