Accessing Liferay webservices remotely

In this post I will show how to call plugin webservice remotely. If we have wsdl file then we can generate the client or stub from wsdl file and invoke the operations/methods of the service.

Before reading this post I would suggest please go through Creating Liferay plugin webservice project
Requirements

Liferay Developer Studio 1.4, wsdl

1. Create a new java project “NewPluginTest” in Liferay Developer Studio 1.4.

remote webservice in liferay

2. Now we have wsdl file so we will generate client or stub from this wsdl file. Do right-click on the project and go to New->Other. Select Web Services->Web Service Client.

remote webservice in liferay

3. Click Next. Make sure Deploy Client is selected in the vertical bar as highlighted in the picture. Click on Browse to select wsdl file.

remote webservice in liferay

4. Click on Browse again to select the wsdl file from a particular location.

remote webservice in liferay

5. Now select the wsdl file and click “OK”. Then again click “OK”.

remote webservice in liferay

6. Now click Finish.

remote webservice in liferay

7. The necessary things will be generated as highlighted in the image.

remote webservice in liferay

8. Now create a main class for testing the service.

remote webservice in liferay

9. Write the logic for testing the service

 

Output

 

Thanks for your patience. Please do not forget to leave a comment.

Soumitra

Software Professional, I am passionate to work on web/enterprise application. For more information please go to about me. You can follow on Twitter. You can be a friend on Facebook or Google Plus or Linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.