首页 / 浏览问题 / 云GIS / 问题详情
REST API 发布服务失败
1EXP 2018年07月05日

 "error": {
        "code": 500,
        "errorMsg": "java.lang.String cannot be cast to com.supermap.services.rest.management.PublishServiceParameter"
    },
    "succeed": false

照着帮助文档来的,报这个错是什么原因

 $(function () {
      var reqData = {
        "servicesTypes": ["RESTMAP"],
        "workspaceConnectionInfo": "D:\\idesktopworkspace\\test2.sxwu"
      };

      $.ajax({
        type: "POST",
        url: "http://localhost:8090/iserver/manager/workspaces.rjson?returnContent=true&token=oQkELk6UUeNghvB_bVUIenL5iOmECzaD1vVWE6VVcs-Fu1Y_fVOzeUAg_lhj40Xpth3VpFoEp2C2wsGHKrRsdg..",
        data: reqData,
        success: function (response) {
          console.log(response);

        }
      });

    })

1个回答

您好,我这试了一下,帮助文档写的没有问题,你看下我写的。

	<script type="text/javascript">
		function init() {
			var postjson ={ 
				"workspaceConnectionInfo": "E:/iServer/811a/samples/data/World/World.sxwu",
				 "servicesTypes": ["RESTMAP"]
			}
			dopoint(postjson);

		}

		function dopoint(postjson) {
			$.ajax({
				type: "POST",
				url: "http://localhost:8091/iserver/manager/workspaces.rjson?token=JdcN6pNlyYT-pMYpll_9A916yxnNoqyIXESswTeRdR2cGf6cVeaNGMNC9dWX44dVl_2G4x2qkK1prk79Y_hd3g..",
				data: JSON.stringify(postjson)
			});
		}
	</script>

4,524EXP 2018年07月06日
...