Question

I have implemented the steps described in this blog Post by Amila Suriarachchi :

http://wso2.com/library/articles/2012/10/implementing-restful-services-wso2-esb

I have done everything mentioned in above Post and i have got API Invocation URL as:

http://10.224.188.113:8280/students 

for StudentAPI.

Now in the Post it has given three Steps as:

1. To add a new student
    curl --request POST -v --data @addPayload.xml -H "Content-type: application/xml"  http://localhost:8280/students/003

2. To get the added student details
    curl --request GET -v  http://localhost:8280/students/003
3. To update the student
    curl --request PUT -v --data @updatePayload.xml -H "Content-type: application/xml"  http://localhost:8280/students/003

4. To delete the student
    curl --request DELETE -v  http://localhost:8280/students/003

to add update and delete and get.But my question is,can i do the above operations without using curl. i can access the url of rest service http://10.224.188.113:8280/students. Now my question is since i have to make this accessible to outer world i have to create a proxy of this rest service, so how can i make proxy of above rest service which provides me all the operations. Looking forward to your answers. Thanks in advance

Was it helpful?

Solution

In the article you have mentioned, Amila has explained about how to define a REST service on ESB.

CURL is a way of testing the REST APIs. Another way to access the REST APIs is using a web browser.

Any client program which can send the REST requests (GET, POST, DELETE, UPDATE) can access your defined student APIs without any issue. You need to host your server in a URL and give the accessibility to that URL for the outsider world. API Manager is such a product you can use to publish your API to outsider world. But it is not necessary.

If you want to expose these as SOAP services for a SOAP client, you can do that as well. For that you can use the following link.

http://docs.wso2.org/wiki/display/ESB460/Using+REST+with+a+Proxy+Service

Hope this help you to figure out your issue.

OTHER TIPS

You can point that API, from APIManager, to make it available to outer world..or else, allow outer world, directly to access your backend api, but it depends on your users and usecase. in the APIManger , we integrated swagger, which will automatically generate the API guide,so user can see details of the operations available in the API

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top