REST API 发布服务失败

0 投票

 "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);

        }
      });

    })

7月 5, 2018 分类:  209次浏览 | 用户: guchiyuan (1 分)

1个回答

0 投票

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

	<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>

7月 6, 2018 用户: 李熙y 名扬四海 (4,436 分)
...