Did you create the style catalog entry first? Something like: curl -v -u USER:PW -XPOST -H "Content-type: text/xml" -d "<style><name>aaabbbb</name><filename>simple.sld</filename></style>" http://GEOSERVER:8080/geoserver/rest/styles ?
What was the response to that? Brad -----Original Message----- From: sulu <[email protected]> Sent: Monday, 23 March 2020 7:16 PM To: [email protected] Subject: [Geoserver-users] Cannot import SLD-Style via REST HI. I constantly get a JAVA-Exception whenever i try to create a new global style with rest. Request: curl -v -u USER:PW -XPUT -H "Content-type: application/vnd.ogc.se+xml" -d @simple.sld http://GEOSERVER/geoserver/rest/styles/aaabbbb Exception: ... org.geoserver.rest.RestException 400 BAD_REQUEST: Invalid style:java.lang.RuntimeException: Parsing failed for Rule: java.lang.ClassCastException: java.util.HashMap cannot be cast to org.opengis.util.InternationalString ... SLD-File: <?xml version="1.0" encoding="UTF-8"?> <StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0"> <NamedLayer> <se:Name>zaehlstellen</se:Name> <UserStyle> <se:Name>zaehlstellen</se:Name> <se:FeatureTypeStyle> <se:Rule> <se:Name>Single symbol</se:Name> <se:PointSymbolizer> </se:PointSymbolizer> </se:Rule> </se:FeatureTypeStyle> </UserStyle> </NamedLayer> </StyledLayerDescriptor> -- Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html _______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-inte grating-new-features-and-improvements-in-GeoServer [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users _______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
