I guess you only need to escape the value for the SLD parameter, like in 
with the JavaScript escape function:

url += "&SLD=" + 
escape("http://localhost:8080/geoserver/DynamicSLDRequest?shapeType=polygon&layer=topp:states";);

Cheers,
Gabriel

sabman wrote:
> I am working on implementing a web service where a user can send parameters
> to change the image returned by WMS. Right now I have written a servlet
> which simply returns a SLD xml file based on the parameters given to it. It
> looks something like this:
> 
> http://localhost:8080/geoserver/DynamicSLDRequest?layer=topp:states&shapeType=polygon
> 
> So I can use this dynamic SLD generator to implement the web service. The
> servlet would take assign parameter "layer" to
> "<NamedLayer><Name>______</Name>...." and return an SLD appropriate for a
> polygon shape. If I make a request to the servlet directly it outputs a
> valid SLD xml.
> 
> Now when I try to use the WMS service and use the "SLD=" feature, I get an
> error. This is how I make the call:
> 
> http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&Format=image/png&request=GetMap&width=550&height=250&srs=EPSG:4326&SLD=http://localhost:8080/geoserver/DynamicSLDRequest?layer=topp:states&shapeType=polygon
> 
> After working on it, I found the error was becasue when I make the call
> through the WMS service, it recognizes only the first parameter that is sent
> in the SLD URL. So in the above example, layer is assigned the correct value
> and shapeType is assigned null. If I send a request with shapeType as the
> first parameter like this:
> 
> http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&Format=image/png&request=GetMap&width=550&height=250&srs=EPSG:4326&SLD=http://localhost:8080/geoserver/DynamicSLDRequest?shapeType=polygon&layer=topp:states
> 
> Then shapeType is assigned the correct value but payer is assigned null. 
> 
> Is there some kind of limitation on the SLD url when used thorugh the WMS
> service for a GetMap operation?


-- 
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to