按照link迁移到Cloud Endpoints Framework之后,我的端点停止了工作。 我的示例端点看起来像这样。
@Api(name = "cocacola", version = "v1")
public class OrganizationEndpoint {
@ApiMethod(name = "subscription.save", path = "subscription",
httpMethod = HttpMethod.POST)
public Map<String, Object> createSubscription(
final SubscriptionRequestDetails subscriptionDetails) {
// my subscription related code
}
}
当我用有效负载点击网址“ http://local.kinley.com:8080/_ah/api/v1/subscription”时,它显示404。
但是当我将端点添加到web.xml的“ init-param”的“ param-value”中时,如下所示,它工作正常。
<servlet>
<servlet-name>EndpointsServlet</servlet-name>
<servlet-class>com.google.api.server.spi.EndpointsServlet</servlet-class>
<init-param>
<param-name>services</param-name>
<param-value>com.cococola.kinley.endpoints.OrganizationEndpoint</param-value>
</init-param>
<init-param>
<param-name>restricted</param-name>
<param-value>false</param-value>
</init-param>
</servlet>
我们是否需要在“ init-param”的“ param-value”中提及我的所有端点?还是我在这里想念任何东西?