Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Rajesh Chaurasia
How to create a portlet to consume a web service?
June 23, 2012 6:48 AM
Answer

Rajesh Chaurasia

Rank: Regular Member

Posts: 119

Join Date: August 18, 2011

Recent Posts

Hi

I wnat to know how can we create a liferay portlet that consumes a published web service which has methods like GetEmployees,UpdateEmployee,DeleteEmployee etc .

Thanks
Hitoshi Ozawa
RE: How to create a portlet to consume a web service?
June 23, 2012 6:55 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Just create like any other Java program which uses web service.
Exactly which part are you having problem with?

Any reason you're trying to call Liferay API through web service rather than java API?>
It is simpler to just call liferay's java API rather than through a web interface.
Rajesh Chaurasia
RE: How to create a portlet to consume a web service?
June 23, 2012 7:19 AM
Answer

Rajesh Chaurasia

Rank: Regular Member

Posts: 119

Join Date: August 18, 2011

Recent Posts

I have a url say http://www.webservicex.net/country.asmx/GetCountries which you may hit and see the response .There are similar urls which expose different methods fo different operation.These are not liferay service.

I want to know how i can write a portlet which can use these urls and make changes as per type of operation .
for GetCountries -->List all countries in a select dropdown in view.jsp of portlet
for DeleteCountry?id=123 -->Delete a country with id 123
for AddCountry?id=321 ->Add a country using add screen
for UpdateCountry?id=123 -->update hte country with id 123
Hitoshi Ozawa
RE: How to create a portlet to consume a web service?
June 23, 2012 7:57 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Just look at codes to the Weather portlet and Stock Price portlet. They call on external web services.
Rajesh Chaurasia
RE: How to create a portlet to consume a web service?
July 14, 2012 7:10 AM
Answer

Rajesh Chaurasia

Rank: Regular Member

Posts: 119

Join Date: August 18, 2011

Recent Posts

sample ws portlet see attachment
Attachments: Setup Webservices in liferay using portlets.docx (193.3k)
Petr Vasek
RE: How to create a portlet to consume a web service?
July 15, 2012 1:59 AM
Answer

Petr Vasek

Rank: Junior Member

Posts: 68

Join Date: June 26, 2012

Recent Posts

Hi Rajesh,
See on my forum thread , where i solved my problwm with web service. Tutorial in your attachmanet is wrong.

Check: -> http://www.liferay.com/community/forums/-/message_boards/message/14823406

Petr
Sameer Srivastava
RE: How to create a portlet to consume a web service?
October 18, 2012 1:58 AM
Answer

Sameer Srivastava

Rank: New Member

Posts: 14

Join Date: August 22, 2012

Recent Posts

Hello Rajesh,

were you able to find solution to call external web service from your portlet ?
I am facing a similar issue and have posted the details here on Liferay forum.

Kindly have a look and share your thoughts.

Regards,

Sameer
desing Raj
RE: How to create a portlet to consume a web service?
January 11, 2013 1:32 AM
Answer

desing Raj

Rank: New Member

Posts: 2

Join Date: January 4, 2013

Recent Posts

Hi Ozawa,

Can you please tell me how to create web service by steps.

Thanks.