1
我想在WSO2 ESB 4.7.0上创建一个API来处理RESTful服务的请求。看起来URL映射功能不起作用,或者像过滤器一样工作,选择发送到端点的内容以及要删除的内容。我遵循本教程:http://wso2.com/library/articles/2012/09/get-cup-coffee-wso2-way/。这里是我的API配置:WSO2 ESB 4.7.0 API url-mapping
<api xmlns="http://ws.apache.org/ns/synapse" name="rest" context="/rest">
<resource methods="GET" url-mapping="/">
<inSequence>
<send>
<endpoint>
<http method="get" uri-template="http://myserver/REST"/>
</endpoint>
</send>
</inSequence>
</resource>
<resource methods="GET" url-mapping="/numbers">
<inSequence>
<send>
<endpoint>
<http method="get" uri-template="http://myserver/REST/allnumbers"/>
</endpoint>
</send>
</inSequence>
</resource>
</api>
有三种情况:
- 该URL的工作原理:
http://esb/rest
- 此URL不起作用:
http://esb/rest/numbers
- 该URL的工作原理:
http://myserver/REST/allnumbers
在情况2中,我收到了一个Apache Tomcat错误:
HTTP Status 404 - Not Found
type Status report
message Not Found
description The requested resource (Not Found) is not available.
Apache Tomcat/6.0.32
但是,如果我尝试端点地址,它的工作原理。我认为URL-Mapping会将“/ numbers”的请求路由到“/ allnumbers”。我究竟做错了什么?