<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I have been able to find how to use the APIMan Gateway<br>
<br>
curl -k -H "Authorization: Bearer $TOKEN"
<a class="moz-txt-link-freetext" href="https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/2.0/123">https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/2.0/123</a><br>
<br>
echo ">>> POST Customer : 124"<br>
<br>
curl -k -H "Authorization: Bearer $TOKEN" -H "Content-Type:
application/json" -X POST -d '{"Customer":{"name":"Charles"}}'
<a class="moz-txt-link-freetext" href="https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/2.0">https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/2.0</a><br>
<br>
echo ">>> GET Customer : 124"<br>
<br>
curl -k -H "Authorization: Bearer $TOKEN"
<a class="moz-txt-link-freetext" href="https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/2.0/124">https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/2.0/124</a><br>
<br>
echo ">>> PUT Customer : 124"<br>
<br>
curl -k -H "Content-Type: application/json" -X PUT -d
'{"Customer":{"id":124,"name":"SMALS"}}' -H "Authorization: Bearer
$TOKEN"
<a class="moz-txt-link-freetext" href="https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/2.0/">https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/2.0/</a><br>
<br>
echo ">>> DEL Customer : 124"<br>
<br>
curl -v -k -X DEL -H "Authorization: Bearer $TOKEN"
<a class="moz-txt-link-freetext" href="https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/2.0/124">https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/2.0/124</a><br>
<br>
echo ">>> GET Customer : 124"<br>
<br>
curl -k -H "Authorization: Bearer $TOKEN"
<a class="moz-txt-link-freetext" href="https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/2.0/124">https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/2.0/124</a><br>
<br>
But the DEL HTTP operation is not supported :
<a class="moz-txt-link-freetext" href="https://github.com/apiman/apiman/issues/152">https://github.com/apiman/apiman/issues/152</a><br>
<br>
On 08/07/15 19:44, Charles Moulliard wrote:<br>
<blockquote cite="mid:559D618F.5010706@redhat.com" type="cite">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
Hi,<br>
<br>
The API Manager allows to map the proxy service (= service to be
authorized) with the real service exposed by example by a REST
Endpoint<br>
<br>
If the REST service exposes GET, PUT, DELETE & POST methods
that we ca nreach using these curl requests :<br>
<br>
1) GET<br>
curl <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://localhost:8080/cxf/rest/customerservice/customers/123">http://localhost:8080/cxf/rest/customerservice/customers/123</a><br>
2) POST<br>
curl -i -H "Content-Type: application/json" -X POST -d
'{"Customer":{"name":"Charles"}}' <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://localhost:8080/cxf/rest/customerservice/customers">http://localhost:8080/cxf/rest/customerservice/customers</a><br>
3) PUT<br>
curl -i -H "Content-Type: application/json" -X PUT -d
'{"Customer":{"id":124,"name":"TUG"}}' <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://localhost:8080/cxf/rest/customerservice/customers">http://localhost:8080/cxf/rest/customerservice/customers</a><br>
4) Delete<br>
curl -X DEL <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://localhost:8080/cxf/rest/customerservice/customers/124">http://localhost:8080/cxf/rest/customerservice/customers/124</a><br>
<br>
I have encoded this service API : <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://localhost:9090/rest/customerservice/customers/">http://localhost:9090/rest/customerservice/customers/</a>
but when I try to reach it using the proxy API ("curl -v -k -H
"Authorization: Bearer $TOKEN<a moz-do-not-send="true"
class="moz-txt-link-rfc2396E"
href="https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/">"
https://127.0.0.1:8443/apiman-gateway/Newcastle/CustomerService/"</a>),
I get this response : Server returned HTTP response code: 405 for
URL: <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://localhost:9090/rest/customerservice/customers">http://localhost:9090/rest/customerservice/customers</a><br>
<br>
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" ?<br>
<br>
<br>
Regards,<br>
<div class="moz-signature">-- <br>
<style>
body { font-family: "Liberation Sans", "Open Sans", sans-serif;
line-height: 1.4em;
/* letter-spacing: 0.01em; */ }
        #red { color: #C1100C; }
        #title { font-weight:bold; color: #808080; }
        #committer { color: #929292; }
        .name { color: #4a4a4a; font-weight:bold }
</style>
<div class="name">Charles Moulliard</div>
<span id="title">Principal Solution Architect / JBoss Fuse
Expert</span> - Global Enablement <span id="red">@redhat</span><br>
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:cmoulliard@redhat.com">cmoulliard@redhat.com</a>
| work: +31 205 65 12 84 | mobile: +32 473 604 014<br>
MC-Square Business "Stockholm", Leonardo Da Vincilaan 19, Diegem
1831 - Belgium<br>
twitter: <a moz-do-not-send="true"
href="http://twitter.com/cmoulliard">@cmoulliard</a> | blog: <a
moz-do-not-send="true" href="http://cmoulliard.github.io">cmoulliard.github.io</a><br>
<span id="committer">committer: apache camel, karaf, servicemix,
hawtio, fabric8, drools, jbpm, deltaspike</span> </div>
</blockquote>
<br>
</body>
</html>