[Apiman-user] Mapping between REST services (GET/POST/PT/DELETE) & API Gateway

Marc Savy marc.savy at redhat.com
Thu Jul 9 05:32:16 EDT 2015


Hi Charles,

> QUESTION : Do I have to encode each service individually or can I
> encode them one time when I declare the API Endpoint of the
> "Service > Implementation" ?>

I'm not quite sure what you mean, so I'll try and illustrate generally.

If I have a 'real' service whose based URL is:
   http://127.0.0.1/my-cool-service/

I decide I want to add it to apiman, and I put the above as the
implementation API Endpoint.

Depending what names I gave my organization, service, version, etc (and
whether it is a public service, SSL config, ...), I might end up with an
endpoint URL like so:

https://localhost:8443/apiman-gateway/my-org/my-cool-service/1.0

Let's imagine that in the real service, we want to call:

   http://127.0.0.1/my-cool-service/bacon
   http://127.0.0.1/my-cool-service/omlette
   http://127.0.0.1/my-cool-service/escargot

Through the gateway this would simply be:

   https://localhost:8443/apiman-gateway/my-org/my-cool-service/1.0/bacon
   https://localhost:8443/apiman-gateway/my-org/my-cool-service/1.0/omlette
   https://localhost:8443/apiman-gateway/my-org/my-cool-service/1.0/escargot

Regards,
Marc

On 08/07/2015 18:44, Charles Moulliard wrote:
> Hi,
>
> The API Manager allows to map the proxy service (= service to be
> authorized) with the real service exposed by example by a REST Endpoint
>
> If the REST service exposes GET, PUT, DELETE & POST methods that we ca
> nreach using these curl requests :
>
> 1) GET
>      curl http://localhost:8080/cxf/rest/customerservice/customers/123
> 2) POST
>      curl -i -H "Content-Type: application/json" -X POST -d
> '{"Customer":{"name":"Charles"}}'
> http://localhost:8080/cxf/rest/customerservice/customers
> 3) PUT
>      curl -i -H "Content-Type: application/json" -X PUT -d
> '{"Customer":{"id":124,"name":"TUG"}}'
> http://localhost:8080/cxf/rest/customerservice/customers
> 4) Delete
>       curl -X DEL
> http://localhost:8080/cxf/rest/customerservice/customers/124
>
> I have encoded this service API :
> http://localhost:9090/rest/customerservice/customers/ but when I try to
> reach it using the proxy API ("curl -v -k -H "Authorization: Bearer
> $TOKEN"
> https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/"), I
> get this response : Server returned HTTP response code: 405 for URL:
> http://localhost:9090/rest/customerservice/customers
>
> QUESTION : Do I have to encode each service individually or can I encode
> them one time when I declare the API Endpoint of the "Service
> Implementation" ?
>
>
> Regards,
> --
> Charles Moulliard
> Principal Solution Architect / JBoss Fuse Expert - Global Enablement @redhat
> cmoulliard at redhat.com | work: +31 205 65 12 84 | mobile: +32 473 604 014
> MC-Square Business "Stockholm", Leonardo Da Vincilaan 19, Diegem 1831 -
> Belgium
> twitter: @cmoulliard <http://twitter.com/cmoulliard> | blog:
> cmoulliard.github.io <http://cmoulliard.github.io>
> committer: apache camel, karaf, servicemix, hawtio, fabric8, drools,
> jbpm, deltaspike
>
>
> _______________________________________________
> Apiman-user mailing list
> Apiman-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/apiman-user
>



More information about the Apiman-user mailing list