简体   繁体   English

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

[英]WSO2 create API for SCEP server HTTP GET POST

I have a SCEP endpoint (Simple Certificate Enrollment Protocol) which is using simple HTTP GET and POST with parameters, for example: 我有一个SCEP端点(简单证书注册协议),它使用带有参数的简单HTTP GET和POST,例如:

http://localhost/scepserver/pkiclient.exe?operation=GetCACaps&message=CA HTTP://localhost/scepserver/pkiclient.exe操作= GetCACaps&消息= CA

I am trying to implement this API in WSO2 Api Manager with endpoint to my SCEP server. 我正在尝试在WSO2 Api Manager中使用我的SCEP服务器的端点来实现此API。 I was trying to do it using "Design a New REST API" but it is not working and I do not want to use JSON in message payload. 我试图使用“设计一个新的REST API”来实现它,但是它不起作用,并且我不想在消息有效负载中使用JSON。

How should I define API for SCEP, with example to call endpoint with query parameters? 我应该如何为SCEP定义API,例如使用查询参数调用端点?

EDIT: 编辑:

Trying through curl: 尝试卷曲:

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

Result: 结果:

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

In the resources section of the design page, you can define expected query parameters for each resource. 在设计页面的资源部分,您可以为每种资源定义期望的查询参数。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM