Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding new Endpoint class in Android Studio

I am learning #GoogleCloudEndpoint on #AndroidStudio using this post https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/HelloEndpoints.

I could create the module and play around with it (changing API names, clients, etc), but when I tried to add another Endpoint (as a class in the same module), I am not able to see those APIs reflected on /_ah/api/explorer.

I don't see any error message while building, but it's just that only one API shows in the explorer. Am not able to figure out what I am missing.

Thanks.

like image 407
Swaroop Joshi Avatar asked Jul 29 '26 06:07

Swaroop Joshi


1 Answers

You will need to make sure that there is an entry in the web.xml file for the `SystemServiceServlet'.

For e.g. consider this element in the web.xml that is a sample from my code:

<servlet>
    <servlet-name>SystemServiceServlet</servlet-name>
    <servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class>
    <init-param>
        <param-name>services</param-name>
        <param-value>com.mindstorm.stocktickerapi.QuoteEndpoint</param-value>
    </init-param>
</servlet>
<servlet-mapping>
    <servlet-name>SystemServiceServlet</servlet-name>
    <url-pattern>/_ah/spi/*</url-pattern>
</servlet-mapping>

Here I have one Endpoint class and that is present in the <param-value> element. Now, if you have another Endpoint class, you should put that here. Just make sure that you separate your classes by a comma separator e.g. com.myclass.endpoint1, com.myclass.endpoint2 and so on.

like image 113
Romin Avatar answered Jul 30 '26 20:07

Romin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!