WSO2为SCEP服务器HTTP GET POST创建API

时间:2017-07-13 12:55:13

标签: api http wso2 wso2-am scep

我有一个SCEP端点(简单证书注册协议),它使用简单的HTTP GET和POST参数,例如:

http://localhost/scepserver/pkiclient.exe?operation=GetCACaps&message=CA

我正在尝试在WSO2 Api Manager中使用端点到我的SCEP服务器实现此API。我试图使用“设计一个新的REST API”来实现它,但它不起作用,我不想在消息有效负载中使用JSON。

我应该如何为SCEP定义API,例如使用查询参数调用端点?

修改

尝试卷曲:

curl -X GET 'http://10.30.9.145:8280/devscep/1/pkiclient.exe?operation=GetCACaps&message=CA' -v

结果:

* Hostname was NOT found in DNS cache
*   Trying 10.30.9.145...
* Connected to 10.30.9.145 (10.30.9.145) port 8280 (#0)
> GET /devscep/1/pkiclient.exe?operation=GetCACaps&message=CA HTTP/1.1
> User-Agent: curl/7.38.0
> Host: 10.30.9.145:8280
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< activityID: 22588072245075117976472
< WWW-Authenticate: realm="WSO2 API Manager"
< Content-Type: application/soap+xml; charset=UTF-8
< Date: Fri, 14 Jul 2017 13:02:16 GMT
< Transfer-Encoding: chunked
<
* Connection #0 to host 10.30.9.145 left intact
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body/></soapenv:Envelope>

1 个答案:

答案 0 :(得分:0)

在设计页面的资源部分,您可以为每个资源定义预期的查询参数。

https://docs.wso2.com/display/AM210/Key+Concepts#KeyConcepts-APIresources