Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
venka reddy
Difference between serviceImpl and localserviceimpl
August 4, 2013 1:20 AM
Answer

venka reddy

Rank: Regular Member

Posts: 231

Join Date: March 23, 2011

Recent Posts

Hi,

What is the difference between serviceImpl and localserviceimpl.
Pankaj Kathiriya
RE: Difference between serviceImpl and localserviceimpl
August 4, 2013 10:03 AM
Answer

Pankaj Kathiriya

Rank: Liferay Master

Posts: 697

Join Date: August 4, 2010

Recent Posts

public methods of serviceinpl class will be exposed as web-service methods if remote-service set as true in service.xml
David Ilechukwu
RE: Difference between serviceImpl and localserviceimpl
August 4, 2013 10:37 AM
Answer

David Ilechukwu

Rank: Regular Member

Posts: 128

Join Date: June 7, 2010

Recent Posts

Also *serviceImpl classes are normally used to implement additional PermissionCheck security for cases where you need to ensure that only valid remote users can access some certain functions (take a look @ UserServiceImpl).

If you intend to use AJAX operations (such as submitting form data to server side without page refresh - then you need to implement *ServiceImpl classes that can then be called with either Alloy UI I/O or Liferay.Service javascript methods.

emoticonHope this helps.
venka reddy
RE: Difference between serviceImpl and localserviceimpl
August 5, 2013 9:31 AM
Answer

venka reddy

Rank: Regular Member

Posts: 231

Join Date: March 23, 2011

Recent Posts

Thanks Pankaj and David . I will try it !

Nice explanation guys.

Once thanks for the reply
venka reddy
RE: Difference between serviceImpl and localserviceimpl
August 5, 2013 10:31 AM
Answer

venka reddy

Rank: Regular Member

Posts: 231

Join Date: March 23, 2011

Recent Posts

Hi,

Where can i find this ajax request, in which portlet it is implemented. If possible elaborate it !
Tonu Sri
RE: Difference between serviceImpl and localserviceimpl
August 5, 2013 10:40 AM
Answer

Tonu Sri

Rank: Regular Member

Posts: 196

Join Date: April 15, 2011

Recent Posts

Hi Venka,

LocalServiceImpl classes are for Local Services Implementation which exists into same application Server.

ServiceImpl classes are for Remote Services implementation which can accessed across application server. Using this implementation Service Builder creates SOAP and JSON implementation of web services.

You can find AJAX example in Address link while editing user.

Thanks:
Tonu
venka reddy
RE: Difference between serviceImpl and localserviceimpl
August 15, 2013 10:14 PM
Answer

venka reddy

Rank: Regular Member

Posts: 231

Join Date: March 23, 2011

Recent Posts

Hi Sri,

I have tried and example but i am getting in valid "Invalid authentication token"

These are the steps i have followed,

1. Created service.xml with remote-service= "true" , ant build

2. Created a method in serviceImpl as follows,

public int getUsers(){
int count = 0;

try {
count = UserLocalServiceUtil.getUsersCount();
} catch (SystemException e) {
e.printStackTrace();
}
return count;
}
and ant build


3. In JSP

<aui:script>

AUI().ready('aui-node', function(A) {
Liferay.Service.Sample.Test.getUsers(function(message) {

var exception = message.exception;
console.log(message);
if (!exception) {

}
else {
alert("In Else");
}
}
);
}
);

</aui:script>

Here Sample is namespace
Test is table name and included service.js as header in liferay-portlet.xml

and deployed portlet and inspected by firebug it gives Invalid authentication token .

Is any thing gone wrong in this procedure?
Tomas Polesovsky
RE: Difference between serviceImpl and localserviceimpl
August 16, 2013 12:08 PM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 643

Join Date: February 13, 2009

Recent Posts

Hi Venka,

what LR version do you use?

Is your Plugins SDK the same version as your Liferay?

Thanks.