Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Raju oukanti
Accessing Liferay WebServices
2 juillet 2013 01:29
Réponse

Raju oukanti

Rang: Regular Member

Publications: 143

Date d'inscription: 20 février 2012

Publications Récentes

Hi All,

Please can any one suggest me how to access the liferay web services through wsdl file. Actually i am using the following wsdl file to acess the liferay web services.
http://10169:test@127.0.0.1:1010/tunnel-web/secure/axis/Portal_EmailAddressService?wsdl .

When iam acessing the services iam getting the following error

ERROR [EmailAddressServiceSoap:103] com.liferay.portal.security.auth.PrincipalException: PermissionChecker not initialized
com.liferay.portal.security.auth.PrincipalException: PermissionChecker not initialized
at com.liferay.portal.service.base.PrincipalBean.getPermissionChecker(PrincipalBean.java:81)
at com.liferay.portal.service.impl.EmailAddressServiceImpl.getEmailAddress(EmailAddressServiceImpl.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:44)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy23.getEmailAddress(Unknown Source)
at com.liferay.portal.service.EmailAddressServiceUtil.getEmailAddress(EmailAddressServiceUtil.java:56)
at com.liferay.portal.service.http.EmailAddressServiceSoap.getEmailAddress(EmailAddressServiceSoap.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


Please help me ASAP.

Thanks,
Raju
Antoine Comble
RE: Accessing Liferay WebServices
2 juillet 2013 01:58
Réponse

Antoine Comble

Rang: Regular Member

Publications: 226

Date d'inscription: 7 septembre 2012

Publications Récentes

Hi Raju,

Are you sure 10169 is login of user and test is his password ?

The url should be :
1
2http://LOGIN:PASSWORD@127.0.0.1:1010/tunnel-web/secure/axis/Portal_EmailAddressService?wsdl


Hope this help you,

Antoine
Raju oukanti
RE: Accessing Liferay WebServices
2 juillet 2013 21:04
Réponse

Raju oukanti

Rang: Regular Member

Publications: 143

Date d'inscription: 20 février 2012

Publications Récentes

Hi Comble,

Thank you for giving quick replay to me.I am using the same url what you suggested to me.But still i am getting the same 'permission checker not intialized ' error.Could you please suggest any other alternative solution.

Thanks,
Raju
Antoine Comble
RE: Accessing Liferay WebServices
3 juillet 2013 00:32
Réponse

Antoine Comble

Rang: Regular Member

Publications: 226

Date d'inscription: 7 septembre 2012

Publications Récentes

Hi,

Are you sure your user is administrator of your portal ?

Regards,

Antoine
Raju oukanti
RE: Accessing Liferay WebServices
3 juillet 2013 03:05
Réponse

Raju oukanti

Rang: Regular Member

Publications: 143

Date d'inscription: 20 février 2012

Publications Récentes

Hi Comble,

Yes he is the administrator user.

Thanks,
Raju
Antoine Comble
RE: Accessing Liferay WebServices
3 juillet 2013 03:18
Réponse

Antoine Comble

Rang: Regular Member

Publications: 226

Date d'inscription: 7 septembre 2012

Publications Récentes

Hi,

Try adding it in your portal-ext.properties :
1
2axis.servlet.hosts.allowed=127.0.0.1,YOUR_PUBLIC_IP
3axis.servlet.https.required=false


If it not woks yet, try this in a main java class :
 1
 2public Test {
 3 public static void main(final String[] args) {
 4                // Portal_EmailAddressService
 5        final EmailAddressServiceSoapServiceLocator locatorMail = new EmailAddressServiceSoapServiceLocator();
 6        EmailAddressServiceSoap serviceEmailAddress = locatorMail.getPortal_EmailAddressService(getURL(liferayUrl, "Portal_EmailAddressService"));
 7        ((Portal_EmailAddressServiceSoapBindingStub) serviceEmailAddress).setUsername(liferayAdminLogin);
 8        ((Portal_EmailAddressServiceSoapBindingStub) serviceEmailAddress).setPassword(liferayAdminPassword);
 9
10               // serviceEmailAddress services are available
11 }
12
13/**
14     * Get URL for serviceName Liferay service.
15     *
16     * @param server
17     * @param serviceName
18     * @return
19     * @throws MalformedURLException
20     */
21    protected static URL getURL(final String server, final String serviceName) throws MalformedURLException {
22        final StringBuilder sb = new StringBuilder();
23        sb.append(server);
24        sb.append("/api/secure/axis/");
25        sb.append(serviceName);
26        return new URL(sb.toString());
27    }
28
29}
Raju oukanti
RE: Accessing Liferay WebServices
15 juillet 2013 22:05
Réponse

Raju oukanti

Rang: Regular Member

Publications: 143

Date d'inscription: 20 février 2012

Publications Récentes

Hi Comble,

Thank you very much. What ever the code given by you is working fine in my local system.Whenever i want to access remotely it is not working.Please can you suggest how can i access the web services remotely ASAP.


Thanks,

Raju
Antoine Comble
RE: Accessing Liferay WebServices
16 juillet 2013 00:38
Réponse

Antoine Comble

Rang: Regular Member

Publications: 226

Date d'inscription: 7 septembre 2012

Publications Récentes

Hi Raju,

Normally, if the user can connect with java code to your webservices, the url http://localhost:1010/api/secure/axis/Portal_EmailAddressService?wsdl should be shown the wsdl of Portal_EmailAddressService webservice.

Hope it will work,

Antoine