WSO2 REST add.jag 获取空指针异常
WSO2 REST add.jag gets null pointer exception
我正在尝试使用 REST add.jag 添加 API。在 1.9.1 和 1.10.0 上都试过了。在仪表板 UI 中添加正常,但出现以下消息
Status code: 200
{
"message": " null",
"error": true
}
并且日志文件显示
[2016-01-10 16:21:22,956] ERROR {JAGGERY.site.blocks.item-add.ajax.add:jag} - java.lang.NullPointerException: null {JAGGERY.site.blocks.item-add.ajax.add:jag}
我在 CURL 和 Python 中都是 运行,得到同样的错误。
这是我发送给 REST 的正文:
body = {
"action" : "addAPI",
"name" : "employee",
"context" : "/employee",
"version=" : "1.0.0",
"visibility" : "public",
"description" : "list employees",
"endpointType" : "nonsecured",
"http_checked" : "http",
"https_checked" : "https",
"tier" : "Unlimited",
"tiersCollection" : "Unlimited,Silver",
"environments" : "Production",
"resourceCount" : "0",
"resourceMethod-0" : "GET",
"resourceMethodAuthType-0" : "Application",
"resourceMethodThrottlingTier-0" : "Unlimited",
"endpointConfig" : '{"production_endpoints":{"url":"http://localhost:8080/sample2/api/company/employees","config":null},"endpoint_type":"http"}'
"endpointType" : "nonsecured"
}
好的,可以使用了。
以下是更新后的 body 参数集
似乎丢失的是 uriTemplate-0。
body
{
"action" : "addAPI",
"name" : "employee",
"context" : "/employee",
"version" : "1.0.0",
"visibility" : "public",
"thumburl" : "",
"description" : "list employees",
"tags" : "company,employees",
"endpointType" : "nonsecured",
"tiersCollection" : "Gold,Silver",
"http_checked" : "http",
"https_checked" : "https",
"bizOwner" : "xx",
"bizOwnerMail" : "xx@ee.com",
"techOwner" : "xx",
"techOwnerMail" : "xx@ee.com",
'resourceCount': '0',
'resourceMethod-0': 'GET',
"resourceMethodAuthType-0" : "Application",
'resourceMethodThrottlingTier-0': 'Unlimited',
"uriTemplate-0" : "/*",
'default_version_checked': 'default_version',
'endpoint_config': '{"production_endpoints":{"url":"http://ws.cdyne.com/phoneverify/phoneverify.asmx","config":null},"endpoint_type":"http"}'
}
我正在尝试使用 REST add.jag 添加 API。在 1.9.1 和 1.10.0 上都试过了。在仪表板 UI 中添加正常,但出现以下消息
Status code: 200
{
"message": " null",
"error": true
}
并且日志文件显示
[2016-01-10 16:21:22,956] ERROR {JAGGERY.site.blocks.item-add.ajax.add:jag} - java.lang.NullPointerException: null {JAGGERY.site.blocks.item-add.ajax.add:jag}
我在 CURL 和 Python 中都是 运行,得到同样的错误。 这是我发送给 REST 的正文:
body = {
"action" : "addAPI",
"name" : "employee",
"context" : "/employee",
"version=" : "1.0.0",
"visibility" : "public",
"description" : "list employees",
"endpointType" : "nonsecured",
"http_checked" : "http",
"https_checked" : "https",
"tier" : "Unlimited",
"tiersCollection" : "Unlimited,Silver",
"environments" : "Production",
"resourceCount" : "0",
"resourceMethod-0" : "GET",
"resourceMethodAuthType-0" : "Application",
"resourceMethodThrottlingTier-0" : "Unlimited",
"endpointConfig" : '{"production_endpoints":{"url":"http://localhost:8080/sample2/api/company/employees","config":null},"endpoint_type":"http"}'
"endpointType" : "nonsecured"
}
好的,可以使用了。 以下是更新后的 body 参数集 似乎丢失的是 uriTemplate-0。
body
{
"action" : "addAPI",
"name" : "employee",
"context" : "/employee",
"version" : "1.0.0",
"visibility" : "public",
"thumburl" : "",
"description" : "list employees",
"tags" : "company,employees",
"endpointType" : "nonsecured",
"tiersCollection" : "Gold,Silver",
"http_checked" : "http",
"https_checked" : "https",
"bizOwner" : "xx",
"bizOwnerMail" : "xx@ee.com",
"techOwner" : "xx",
"techOwnerMail" : "xx@ee.com",
'resourceCount': '0',
'resourceMethod-0': 'GET',
"resourceMethodAuthType-0" : "Application",
'resourceMethodThrottlingTier-0': 'Unlimited',
"uriTemplate-0" : "/*",
'default_version_checked': 'default_version',
'endpoint_config': '{"production_endpoints":{"url":"http://ws.cdyne.com/phoneverify/phoneverify.asmx","config":null},"endpoint_type":"http"}'
}