Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Mourad Benkhellat
Build a portlet from a WSDL file
December 20, 2011 12:07 PM
Answer

Mourad Benkhellat

Rank: New Member

Posts: 1

Join Date: November 25, 2011

Recent Posts

Hi,

I am developping a web service in .NET (WCF, Visual Studio, c#), and it's working with a .Net Client.

I am thinking of using a portlet in liferay as a thin client for my web service. What is the easiest way to build my portlet giving that I have the WSDL file of my web service?

Thnx
David H Nebinger
RE: Build a portlet from a WSDL file
December 20, 2011 1:45 PM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7227

Join Date: September 1, 2006

Recent Posts

Use the wsimport command to create a service layer for the web service. Use your preferred framework technology (JSP/Struts, Spring Portlet MVC, JSF, Vaadin) to create the interface for the service and use the generated service layer to make the calls.
Hitoshi Ozawa
RE: Build a portlet from a WSDL file
December 20, 2011 3:44 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

The easiest probably is to just to use jquery to call your web service.

See the following pages:

http://www.liferay.com/downloads/liferay-portal/community-plugins/-/software_catalog/products/7064853?_98_redirect=%2Fdownloads%2Fliferay-portal%2Fcommunity-plugins

http://www.liferay.com/web/nathan.cavanaugh/blog/-/blogs/using-jquery-or-any-javascript-library-in-liferay-6-0

http://www.andrewrowland.com/article/display/consume-dot-net-web-service-with-jquery/
David H Nebinger
RE: Build a portlet from a WSDL file
December 21, 2011 5:32 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7227

Join Date: September 1, 2006

Recent Posts

Hmm, interesting links Hitoshi. Does not make the data available directly to the portlet, just the browser. Assuming you wanted to put the results in a dropdown or something, the portlet would just have to trust the incoming value came from the web service and use it as is...

What kind of use case have you run into where doing the web service call in the browser was preferred over doing it in the portlet?
Stian Sigvartsen
RE: Build a portlet from a WSDL file
December 21, 2011 6:19 AM
Answer

Stian Sigvartsen

Rank: Junior Member

Posts: 98

Join Date: August 27, 2010

Recent Posts

Use the wsimport command

This sounds very interesting. Is this a command that's part of the Liferay Service Builder or a generic command that's part of Axis or similar?

-Stian
David H Nebinger
RE: Build a portlet from a WSDL file
December 21, 2011 6:44 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7227

Join Date: September 1, 2006

Recent Posts

It's part of the java6 spec for jaxws. No axis or other components are needed, as long as you have java6 or greater.
Hitoshi Ozawa
RE: Build a portlet from a WSDL file
December 21, 2011 1:04 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

I think portlets such as weather portlet and translation portlet is just making external calls to outside services.
David H Nebinger
RE: Build a portlet from a WSDL file
December 21, 2011 1:18 PM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7227

Join Date: September 1, 2006

Recent Posts

Oh, so only in cases where the portlet itself is not expected to do anything w/ the data retrieved (i.e. the weather portlet can make the web service call in the browser to show the weather, but the weather itself doesn't need to be processed on the server side at all).

I guess outside of maps I've never seen a real need for this kind of use case, but I'm sure there are probably many more examples should I put my mind to them...

Thanks, Hitoshi!
Sharana Basavaraj Ballari
RE: Build a portlet from a WSDL file
December 22, 2011 2:59 AM
Answer

Sharana Basavaraj Ballari

Rank: Regular Member

Posts: 136

Join Date: September 9, 2007

Recent Posts

David H Nebinger:
It's part of the java6 spec for jaxws. No axis or other components are needed, as long as you have java6 or greater.


Thanks for the info David. emoticon

Sharan