Я использую WSO2 APIM 3.0.0 ( source am ), работающий в Docker.
Я пытаюсь защитить ресурсы API с помощью Scope. Мой API предоставляет API REST для службы SOAP (эта служба SOAP является общедоступной c: http://www.dneonline.com/calculator.asmx).
Это ресурсы, которые я создал из SOAP служба:
Я создаю область:
Тогда я применить область действия к ресурсу «Вычитание»:
Но когда я вызываю Substract из PostMan, он получает ответ (конечно, запрос содержит токен доступа ):
<code><html>
<head>
<title>Request format is unrecognized for URL unexpectedly ending in '/subtract'.</title>
<style>
body {
font-family: "Verdana";
font-weight: normal;
font-size: .7em;
color: black;
}
p {
font-family: "Verdana";
font-weight: normal;
color: black;
margin-top: -5px
}
b {
font-family: "Verdana";
font-weight: bold;
color: black;
margin-top: -5px
}
H1 {
font-family: "Verdana";
font-weight: normal;
font-size: 18pt;
color: red
}
H2 {
font-family: "Verdana";
font-weight: normal;
font-size: 14pt;
color: maroon
}
pre {
font-family: "Lucida Console";
font-size: .9em
}
.marker {
font-weight: bold;
color: black;
text-decoration: none;
}
.version {
color: gray;
}
.error {
margin-bottom: 10px;
}
.expandable {
text-decoration: underline;
font-weight: bold;
color: navy;
cursor: hand;
}
</style>
</head>
<body bgcolor="white">
<span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
<h2> <i>Request format is unrecognized for URL unexpectedly ending in '/subtract'.</i> </h2></span>
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
<b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please
review the stack trace for more information about the error and where it originated in the code.
<br><br>
<b> Exception Details: </b>System.InvalidOperationException: Request format is unrecognized for URL unexpectedly
ending in '/subtract'.<br><br>
<b>Source Error:</b> <br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code>
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>
</td>
</tr>
</table>
<br>
<b>Stack Trace:</b> <br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>
[InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/subtract'.]
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +405897
System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +212
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +193
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Информация о версии: Microsoft. NET Версия Framework: 2.0.50727.8806; ASP. NET Версия: 2.0.50727.8762
Вы все можете проверить мой API через:
Devportal: https://wso2hungam.xplat.fpt.com.vn/devportal/apis (пользователь / пароль: hunglv / hunglv).
Назначение API: https://wso2servicehungam.xplat.fpt.com.vn/calculate/1.0.0/subtract
Tks all.