Hi Supun,

We are infering the API name, and the version based on the webapp name,
right? That means if a webapp does not have a version (ex. example.war),
then the managed api name is "example", and it should be created with the
default version. If a webapp does specify a version (ex.
example#v1.0.0.war), then the api name will be "example" and the version
will be "v1.0.0", correct?

Then, you can use the *javax.servlet.http.HttpServletRequest#getContextPath*
API [1] from your valve to figure out the Managed API since it is created
analogous to the webapp naming convention.
HttpServletRequest#getContextPath API can be used to uniquely identify the
webapp for which the current request is routed to. With that information in
hand, we can figure out which managed api to use.

WDYT?

[1]
https://docs.oracle.com/javaee/5/api/javax/servlet/http/HttpServletRequest.html#getContextPath()

On Mon, Jun 8, 2015 at 4:47 PM, Supun Malinga <sup...@wso2.com> wrote:

> Hi,
>
> I'm trying to work with default version support for APIs in api-everywhere
> work in AS. SO far I got numerous issues in handling version.
>
> Among other things identifying the version of the API is not working. For
> eg:
> eg:
> request URL :
>
> http://11.168.57.1:9763/jaxrs_basic/services/customers/customerservice/customers/123
>
> Then APIManagetInterceptorUtils.getAPIVersion(request) returns "services"
> as the version, which is clearly wrong.
>
> Do let me know if APIM team has fixes for these. Meanwhile I'll try to
> work around the issue.
>
> thanks,
> --
> Supun Malinga,
>
> Senior Software Engineer,
> WSO2 Inc.
> http://wso2.com
> email: sup...@wso2.com <sup...@wso2.com>
> mobile: +94 (0)71 56 91 321
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to