问题描述
我想通过rest API在GeoServer中创建一个wmslayer
请求的网址是:
http://localhost:8080/geoserver/rest/workspaces/layergroups/wmslayers
这是 XML 格式的请求正文:
<?xml version="1.0" encoding="UTF-8"?>
<wmsLayer>
<name>layer6</name>
<nativeName>layer6</nativeName>
<namespace>
<name>layergroups</name>
<link>http://localhost:8080/geoserver/rest/namespaces/layergroups.json</link>
</namespace>
<title>layer6</title>
<abstract>layer6</abstract>
<description>layer6</description>
<keywords>
<string>WCS</string>
</keywords>
<nativeCRS>epsg:4326</nativeCRS>
<srs>epsg:4326</srs>
<nativeBoundingBox>
<minx>40</minx>
<maxx>20.00</maxx>
<miny>59.99</miny>
<maxy>40</maxy>
<crs>epsg:4326</crs>
</nativeBoundingBox>
<latLonBoundingBox>
<minx>40</minx>
<maxx>20.00</maxx>
<miny>59.99</miny>
<maxy>40</maxy>
<crs>epsg:4326</crs>
</latLonBoundingBox>
<projectionPolicy>FORCE_DECLARED</projectionPolicy>
<enabled>true</enabled>
<Metadata>
<entry key="cachingEnabled">false</entry>
</Metadata>
<store class="wmsstore">
<name>layergroups:altgs</name>
<href>http://localhost:8080/geoserver/rest/workspaces/layergroups/wmsstores/altgs.xml</href>
</store>
<forcedRemoteStyle>dem_style</forcedRemoteStyle>
<selectedRemoteFormats>
<string>image/png</string>
<string>image/jpeg</string>
<string>image/tiff</string>
<string>image/gif</string>
<string>image/geotiff</string>
<string>image/png8</string>
<string>image/tiff8</string>
<string>image/geotiff8</string>
</selectedRemoteFormats>
<preferredFormat>image/png</preferredFormat>
<selectedRemoteStyles>
<string>dem_style</string>
<string>another_dem_style</string>
</selectedRemoteStyles>
<allAvailableRemoteStyles>
<style>
<name>dem_style</name>
<format>sld</format>
<languageVersion>
<version>1.0.0</version>
</languageVersion>
<legend>
<width>20</width>
<height>20</height>
<format>image/png</format>
<onlineResource>https://remote.wms.server/geoserver/wms?request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=topp%3Astates&style=dem_style</onlineResource>
</legend>
</style>
</allAvailableRemoteStyles>
<minScale>1000000.0</minScale>
<maxScale>1.0E7</maxScale>
<MetadataBBoxRespected>false</MetadataBBoxRespected>
</wmsLayer>
邮递员的回复是:
com.sun.proxy.$Proxy105 cannot be cast to org.geoserver.catalog.WMsstoreInfo
和状态是500服务器错误
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)