留言板

Remote calls to Services from external apps (via Soap, Tunneling, etc.)

thumbnail
Joel Kozikowski,修改在17 年前。

Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Expert 帖子: 405 加入日期: 06-6-28 最近的帖子
For integration with a legacy app, I have a need to call some of my custom services (built in the extension environment) from an external Java application (running on a remote machine).

I'm trying to get a handle on the best way to do this, what code is ALREADY built into Liferay and the ServiceBuilder system, what needs to be done manually, etc. I'm willing to write some docs and put it in the Wiki if someone from the Liferay team (or some better informed community members) can point me in the right direction...

First, I don't want to use EJB - I'm deploying my portal in a Tomcat environment. SOAP is an option, as is the custom Tunneling. Hessian or Burlap would be fine also. I'm most familiar with Spring Remoting (in particular, their Http remoting system), but I don't think Liferay supports it (at the moment). While I certainly can get it working with Spring, I'm looking for the "easy" solution which I think already exists.

I'm using the extension environment, and have created a custom entity (let's say its MyEntity). The code I want to call is in MyEntityServiceImpl.java

I'm trying to get a handle on exactly what some of the pre-generated code does: in particular, MyEntityServiceHttp.java and MyEntityServiceSoap.java

I've been studying the code, and here is what I know (and don't know). Can anyone help confirm or deny these assumptions:

1) MyEntityServiceHttp.java is a stub that the CLIENT APP can call to use the Tunneling Servlet to call into MyEntityServiceImpl server side. I have written a small test app (using what little info I found in the Wiki regarding remoting). This seems to work, but has a somewhat surprising set of dependencies for my client app. In order for stand-alone client app to call my service, I need the following .jar files available in my classpath:


/ext/ext-ejb/ext-ejb.jar
/ext/ext-service/ext-service.jar

/portal/portal-ejb/portal-ejb.jar
/portal/portal-kernel/portal-kernel.jar
/portal/util-java/util-java.jar
/portal/lib/portal/concurrent.jar
/portal/lib/portal/commons-logging.jar
/portal/lib/portal/log4j.jar"
/portal/lib/portal/dom4j.jar
/portal/lib/development/servlet.jar
/portal/lib/portal/easyconf.jar
/portal/lib/portal/commons-lang.jar
/portal/lib/portal/commons-digester.jar
/portal/lib/portal/commons-configuration.jar
/portal/lib/portal/xstream.jar
/portal/lib/portal/commons-collections.jar
/portal/lib/portal/commons-beanutils.jar
/portal/lib/portal/jcr.jar
/portal/lib/portal/velocity.jar
/portal/portal-service/portal-service.jar


WOW! That's a lot of library code just to make a remote call. It appears to include most of the code required to run the portal in the first place! I was particularly suspicious of the need to include Velocity (what does Velocity have to do w/ tunneling). I think it is perhaps because there are so many dependencies in the initialization phases of most of the utility methods, it includes about everything. It was this huge list that leads me to believe that perhaps Tunneling is not intended for use by a stand alone J2SE Java app, and is instead perhaps best for portal to portal calls.

So, now I'm thinking perhaps "SOAP" is the answer:

2) From my (somewhat limited) study of the code, it appears that MyEntityServiceSoap.java is some code that resides SERVER SIDE that accepts the incomming call from a SOAP call and dispatches to MyEntityServiceImpl. Is there any generated client side code I can use?

I've found the portal-client.jar in the source tree. It apperas to contain all the CLIENT SIDE code for connecting to the SERVER SIDE xxServiceSoap.java facades. Is this code generated? How is it generated? Simply by running the build-client target in the /portal/portal-client/build.xml Ant file? Is there similar such automatic generation (Ant files or otherwise) for the Extension Environment? Do I instead need to generate my own WSDL? Is there some URL I can call on my running Liferay instance that will generate the WSDL?

Finally - I've heard Hesian and Burlap mentioned in the docs, but have found NOTHING about actually using them in the docs, the forums, the Wiki, etc.

Any tips would be appreciated! I'll take the knowledge gathered here and put it in the Wiki.
thumbnail
Joel Kozikowski,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Expert 帖子: 405 加入日期: 06-6-28 最近的帖子
Still trying to figure this out. While I'm still hopeful to receive some help here, I've found a few more clues.

It appears the "entry point" for all of remoting is the "tunnel-web" web application. By looking in my Tomcat's "webapps" directory, I see the "tunne-web" application. The tunnel-web/WEB-INF is providing a ton of information. I see now by looking at the tunneling server's web.xml all of the servlets involved in the remoting. I also see the file remoting-servlet.xml, which contains Spring definitions for Burlap, Hessian, and even Spring's Http Invoker.

I should be able to piece together how it all fits together with this info, but I still would appreciate someone else's knowledge on the subject to short-circuit the process emoticon

I've discovered the "build-wsdd" target in the of the ext-ejb/build.xml Ant file, but when I run it, I get errors (my services reference some of the objects from the Liferay core). Its complaining about:


 java.io.IOException: Type {http://model.portal.liferay.com}User is referenced but not defined.


If I can unravel the references issue, I may be able to make a little more progress.
thumbnail
Ivano Carrara,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Expert 帖子: 345 加入日期: 05-7-3 最近的帖子
Hi!

I'm using Liferay Portal 4.2.1 on Tomcat.

I need to manage files in the Document Library - these files are generated from external applications... These processes generates Pdf, Xml and other kind of files.

Cause the only method to put and get files in the Liferay's Document Library is by hands because there isn't WebDav and/or Ftp interface, I'm trying to put and get files into the Liferay's Document Library via Web Services without human actions.

Pointing my Web browser to the Liferay server at http://www.<myliferayserver>.com/tunnel-web/axis I can see the Axis's output "And now... Some Services" ... inside the page I can see the section about the Document Library's service:
-------------------------------------------------------
Portlet_Document_Library_DLFileEntryService (wsdl)
addFileEntry
addFileEntry
deleteFileEntry
deleteFileEntry
getFileEntry
lockFileEntry
unlockFileEntry
updateFileEntry
----------------------------------------------------------
Then, clicking on the (wsdl) link I save the wsdl file on my Pc.

BUT when I try to open the .wsdl file with a Xml validator to try to generate the Web Service client code I get the error:

"extensibility element '<wsdlsoap:operation>' (operation 'addFileEntry', binding 'Portlet_Document_Library_DLFileEntryServiceSoapBinding') has empty or missing 'soapAction' attribute! (required if binding transport is 'http://schemas.xmlsoap.org/soap/http')"

It's helps to this post ?

I hope we can cooperate to access the Liferay services via Web Services!

Ivano C.
thumbnail
Joel Kozikowski,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Expert 帖子: 405 加入日期: 06-6-28 最近的帖子
If all you are looking for is to make a SOAP call to pre-existing Liferay services (i.e. the services defined in the core Liferay system), then I think all you need to do is write a stand alone program that uses the portal-client.jar file referenced in my first post. That jar file contains all the client stubs to call the core Liferay services.

My problem is/was making SOAP client stubs for MY custom services (built in the extension environment). I've since turned my attention to using other remoting methods. I've got code working using the Tunnel Sevlet (which simply class MyEntityServiceHttp to make the remote call). The only issue with that solution is that it requires just about every library under the sun - including core Liferay SERVER side code, Velocity, etc.

I'm trying to get something a little more "lightweight". I think my approach will be to use Spring Remoting - Http Invoker specifically, to call the Spring exposed versions of the Liferay code. It looks like all of the server side code and definitions are in place. I'll simply need to hand code the client side Spring definitions (which is fairly simple: Google for information re: Spring's HttpInvokerProxyFactoryBean).
thumbnail
Ivano Carrara,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Expert 帖子: 345 加入日期: 05-7-3 最近的帖子
Dear Joel, I just wrote a new post about using Web Services here:
http://www.liferay.com/web/guest/community/forums/message_boards/message/103996

I read in the past your posts and other about Virtual Host and I know you are an experienced Liferay developer.

For my needs, I wish to speack with you directly. It's possible?

Please, could you write me your private email address?

My email is icarrara@studio5.it

Sincerely,
Ivano C.
thumbnail
Joel Kozikowski,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Expert 帖子: 405 加入日期: 06-6-28 最近的帖子
Ivano -

Not that I don't like to give people my email address, but I think a private, off-line discussion would not be in the spirit of community. What little time I have to help others, I prefer to do it here in the forums (so the msg will be archived, and searchable by others).

That being said...

1) I'm not a member of the Liferay dev team. I'm just a community member who works with the software at my job. What little I know about the software, I've learned by studying the code over the last 8 months.

2) I've got very little SOAP experience (Liferay, or otherwise). All the remoting I've done in the past has been Spring Http Invoker based, which is why I am going to pursue that avenue in the future. For NOW, I've got the tunneling interface working (see my initial post), so since I've got SOMETHING working, I'm moving on to other more pressing matters.

3) Liferay does have professoinal consulting services available. If you REALLY need help, and your company needs it fast, I suggest you contact sales@liferay.com

Sorry - I feel your pain. Unfortunately, most of my time is spent enduring similar pain in other areas of the software emoticon.
thumbnail
Ivano Carrara,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Expert 帖子: 345 加入日期: 05-7-3 最近的帖子
Dear Joel, thank you for your fast and gentle reply.

My intention was to ask you if you can do some work for me relating to the use of Liferay client.

So, if you can speak about the above I'll appreciate it.

Sincerely,
Ivano C.
thumbnail
Joel Kozikowski,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Expert 帖子: 405 加入日期: 06-6-28 最近的帖子
Ivano Carrara:
My intention was to ask you if you can do some work for me relating to the use of Liferay client.


Unfortunately, I'm not available to do work for others - I've got enough work of my own to last me until about 2012!

I'd contact Liferay, Inc. That is what they are there for (its their business afterall), and they know a LOT more about the code than I do.
thumbnail
Felipe Grajales,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Junior Member 帖子: 38 加入日期: 05-10-18 最近的帖子
Hi Joel,

time to time people contact us to develop portlets and portal content.
Right now we are looking for people with expertise in liferay
are you interested? If so please answer these questions.


1. Where are you from?
2. How much time have you been developing with liferay ?
3. What is your email address ?
4. Have you developed hot deployable velocity themes ?
5. Besides Java what other language do you know?
6. Can you give us email addresses of other persons that might be interested ?



Thank you

Felipe
thumbnail
Igor Kravinski,修改在16 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

New Member 帖子: 10 加入日期: 07-7-26 最近的帖子
Joel Kozikowski:
If all you are looking for is to make a SOAP call to pre-existing Liferay services (i.e. the services defined in the core Liferay system), then I think all you need to do is write a stand alone program that uses the portal-client.jar file referenced in my first post. That jar file contains all the client stubs to call the core Liferay services.


I have a question regarding this
http://www.liferay.com/web/guest/community/forums/message_boards/message/123881

hope someone can help.
Thanks
thumbnail
R - Manzano,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Junior Member 帖子: 25 加入日期: 06-9-26 最近的帖子
Hi!
I'm trying to do the same thing as you with the document library.Looking the posts of everyone i don't find any usefull information.I think i'm not the only one with the same proplems so I focus on you to solve them.I think you have the answers so we will be so happy if you solve them.

1.-if you want to view the wsdl from another pc it seems to be enougt if you modify the portal-ext.properties adding the tunnel.servlet.hosts.allowed and the tunnel.servlet.https.required
it's enough with only this

2.-when we try to access to the services with the stubs(they are on the developer seccion in the liferay web page) when we run it some of us get a

16:26:40,347 ERROR [UserServiceSoap:60] java.lang.NullPointerException
java.lang.NullPointerException
at com.liferay.portal.service.permission.UserPermission.contains(UserPermission.java:67)
at com.liferay.portal.service.permission.UserPermission.check(UserPermission.java:46)
at com.liferay.portal.service.impl.UserServiceImpl.checkPermission(UserServiceImpl.java:331)

it seems to be a permision problem, ¿how does we authenticate to the webservices?

¿its posible a code snipet?


thank you very very very very much
Mani Kandan,修改在16 年前。

How to configure Public and Private Virtual Host in Liferay 4.3

thumbnail
Joel Kozikowski,修改在16 年前。

RE: How to configure Public and Private Virtual Host in Liferay 4.3

Expert 帖子: 405 加入日期: 06-6-28 最近的帖子
Mani Kandan:
I have installed Liferay 4.3 and i need to create the Virtual Host for the Public and Private Host, how to do this.


I think you posted to the wrong thread - this one is about making remote calls.

In any event - for you question, see this page in the wiki.
thumbnail
Stella Sjel,修改在16 年前。

RE: How to configure Public and Private Virtual Host in Liferay 4.3

New Member 帖子: 7 加入日期: 07-7-5 最近的帖子
hello all,

question,
why when i create user via soap, it does not create new row in the Layout table for the newly created user?

many thanks,
stel
thumbnail
Stella Sjel,修改在16 年前。

RE: How to configure Public and Private Virtual Host in Liferay 4.3

New Member 帖子: 7 加入日期: 07-7-5 最近的帖子
hi all,

solved it by calling Portal_LayoutService (wsdl) addLayout.

but now i get an error. blog entry was successfully added but an error appears




07:23:40,954 ERROR [service.http.BlogsEntryServiceSoap] java.lang.NullPointerException
java.lang.NullPointerException
        at com.liferay.portlet.tags.service.impl.TagsAssetLocalServiceImpl.updateAsset(TagsAssetLocalServiceImpl.java:153)
        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:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy96.updateAsset(Unknown Source)
        at com.liferay.portlet.tags.service.TagsAssetLocalServiceUtil.updateAsset(TagsAssetLocalServiceUtil.java:132)
        at com.liferay.portlet.blogs.service.impl.BlogsEntryLocalServiceImpl.addEntry(BlogsEntryLocalServiceImpl.java:162)
        at com.liferay.portlet.blogs.service.impl.BlogsEntryLocalServiceImpl.addEntry(BlogsEntryLocalServiceImpl.java:101)
        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:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy91.addEntry(Unknown Source)
        at com.liferay.portlet.blogs.service.BlogsEntryLocalServiceUtil.addEntry(BlogsEntryLocalServiceUtil.java:95)
        at com.liferay.portlet.blogs.service.impl.BlogsEntryServiceImpl.addEntry(BlogsEntryServiceImpl.java:100)
        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:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy47.addEntry(Unknown Source)
        at com.liferay.portlet.blogs.service.BlogsEntryServiceUtil.addEntry(BlogsEntryServiceUtil.java:79)
        at com.liferay.portlet.blogs.service.http.BlogsEntryServiceSoap.addEntry(BlogsEntryServiceSoap.java:110)
        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:585)
        at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
        at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
        at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
        at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
        at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
        at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
        at com.liferay.portal.servlet.AxisServlet.service(AxisServlet.java:74)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at com.liferay.portal.kernel.servlet.PortalClassLoaderServlet.service(PortalClassLoaderServlet.java:88)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at com.liferay.filters.secure.SecureFilter.doFilter(SecureFilter.java:144)
        at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:80)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
        at java.lang.Thread.run(Thread.java:595)
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.rmi.RemoteException
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}hostname:my.liferay.com

java.rmi.RemoteException
        at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
        at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
        at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(Unknown Source)
        at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
        at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
        at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at com.liferay.client.portlet.blogs.service.http.Portlet_Blogs_BlogsEntryServiceSoapBindingStub.addEntry(Portlet_Blogs_BlogsEntryServiceSoapBindingStub.java:332)
        at org.test.ProcessEntry.processRequest(ProcessEntry.java:102)
        at org.test.ProcessEntry.doPost(ProcessEntry.java:190)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
        at java.lang.Thread.run(Thread.java:595)





and also when I create a new user I'm getting this



07:22:57,805 ERROR [kernel.util.MethodInvoker] Cannot invoke com.liferay.mail.util.DummyHook addUser on position 3 because it is null
07:22:57,806 ERROR [service.jms.MailConsumer] java.lang.NullPointerException
java.lang.NullPointerException
        at com.liferay.portal.kernel.util.MethodInvoker.invoke(MethodInvoker.java:72)
        at com.liferay.portal.kernel.util.MethodInvoker.invoke(MethodInvoker.java:47)
        at com.liferay.mail.service.jms.MailConsumer._onMessage(MailConsumer.java:117)
        at com.liferay.mail.service.jms.MailConsumer.onMessage(MailConsumer.java:85)
        at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:854)
        at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:99)
        at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:166)
        at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:117)
        at org.apache.activemq.thread.PooledTaskRunner.access$100(PooledTaskRunner.java:26)
        at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:44)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)





thanks in advance,
stel
thumbnail
Jonas Yuan,修改在14 年前。

RE: How to configure Public and Private Virtual Host in Liferay 4.3

Liferay Master 帖子: 993 加入日期: 07-4-27 最近的帖子
Hi Stella,

Do you get this issue fixed? Any updates on this?

Thanks

Jonas Yuan
-------------------------
Liferay Books

Liferay Portal 5.2 Systems Development
Liferay Portal Enterprise Intranets
Ken Barron,修改在12 年前。

RE: How to configure Public and Private Virtual Host in Liferay 4.3

New Member 帖子: 5 加入日期: 11-10-5 最近的帖子
See this very useful wiki post for a working example in Liferay 6 of calling a Liferay service using SOAP services and the tunnel-web: http://www.liferay.com/community/wiki/-/wiki/Main/Web+Service+samples
thumbnail
Stella Sjel,修改在16 年前。

RE: How to configure Public and Private Virtual Host in Liferay 4.3

New Member 帖子: 7 加入日期: 07-7-5 最近的帖子
Hi all..

Question,

is it possible to upload an image in photo gallery using soap?
i hope somebody can help.. thank you! emoticon
thumbnail
Joel Kozikowski,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Expert 帖子: 405 加入日期: 06-6-28 最近的帖子
There seem to be a couple of threads percolating re: remote access to services. I just wanted to cross reference them in case someone stumbles across one or the other:

http://www.liferay.com/web/guest/community/forums/message_boards/message/103368
thumbnail
Michael Young,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Liferay Master 帖子: 846 加入日期: 04-8-5 最近的帖子
Joel,

I would check out the sample-portal-client-portlet.war from our downloads. It contains an example of how to invoke our Web Services using SOAP.
Max H,修改在1 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

New Member 帖子: 23 加入日期: 07-2-2 最近的帖子
Hi Michael,

I took a peek at the sample-portal-client-portlet.war (for 4.2.1) and it contains only one java source file which appears to be just a few lines of skeleton portlet code and has no SOAP code in whatsoever.

Please can you check it.

public class PortalClientPortlet extends GenericPortlet {

	public void doDispatch(RenderRequest req, RenderResponse res)
		throws IOException, PortletException {

		include("/view.jsp", req, res);
	}

	protected void include(String path, RenderRequest req, RenderResponse res)
		throws IOException, PortletException {

		PortletRequestDispatcher prd =
			getPortletContext().getRequestDispatcher(path);

		if (prd == null) {
			_log.error(path + " is not a valid include");
		}
		else {
			prd.include(req, res);
		}
	}

	private static Log _log = LogFactory.getLog(PortalClientPortlet.class);

}


Thanks,
Max
thumbnail
Jean-Charles FELICITE,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

New Member 帖子: 5 加入日期: 07-2-21 最近的帖子
Hi Max Max Max,

The soap code is placed in the view.jsp page.

Here it is :

&lt;%@ page import="com.liferay.client.portal.model.OrganizationSoap" %&gt;
&lt;%@ page import="com.liferay.client.portal.service.http.OrganizationServiceSoap" %&gt;
&lt;%@ page import="com.liferay.client.portal.service.http.OrganizationServiceSoapServiceLocator" %&gt;

&lt;%@ page import="java.net.URL" %&gt;

You belong to the following organizations:

<br><br>

&lt;%
OrganizationServiceSoapServiceLocator locator = new OrganizationServiceSoapServiceLocator();

OrganizationServiceSoap soap = locator.getPortal_OrganizationService(_getURL("Portal_OrganizationService"));

OrganizationSoap[] organizations = soap.getUserOrganizations(request.getRemoteUser());

for (int i = 0; i &lt; organizations.length; i++) {
	OrganizationSoap organization = organizations[i];
%&gt;

	&lt;%= organization.getName() %&gt;<br>

&lt;%
}
%&gt;

&lt;%!
private URL _getURL(String serviceName) throws Exception {

	// Unathenticated url

	String url = "http://localhost:8080/tunnel-web/axis/" + serviceName;

	// Authenticated url

	if (true) {
		String userId = "liferay.com.1";
		String password = "qUqP5cyxm6YcTAhz05Hph5gvu9M=";

		url = "http://" + userId + ":" + password + "@localhost:8080/tunnel-web/secure/axis/" + serviceName;
	}

	return new URL(url);
}
%&gt;


JC
thumbnail
Joel Kozikowski,修改在16 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Expert 帖子: 405 加入日期: 06-6-28 最近的帖子
Another cross-reference to another thread re: Spring Remoting. I think we've finally got to the bottom of all the issues (this thread deals with permissions problems):

http://www.liferay.com/web/guest/community/forums/message_boards/message/106916
thumbnail
David Wayne Brown,修改在16 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

New Member 帖子: 24 加入日期: 05-7-28 最近的帖子
Hey Joel,

If you want to get your own SOAP calls working you can make a quick mod to the ant build scripts:

1) In ext-ejb/build-parent.xml add the following lines to extract the server-config.wsdd from tunnel-web.war just before you do the build-wsdd:

<unwar src="../ext-ear/modules/tunnel-web.war" dest="tmp-tunnel-web" />
<copy file="tmp-tunnel-web/WEB-INF/server-config.wsdd" todir="../ext-web/docroot/WEB-INF" overwrite="true" />
<delete dir="tmp-tunnel-web" />

Your service definitions will then be added to the existing Liferay definitions when you invoke build-wsdd.

2) In ext-ear/build-parent.xml add the following line to copy the updated server-comfig.wsdd to the deploy directory just after the deploy-war for tunnel-web:

<copy file="../ext-web/docroot/WEB-INF/server-config.wsdd" todir="${app.server.deploy.dir}/tunnel-web/WEB-INF" overwrite="true" />

That way tunnel-web deploys the Liferay version and you over-write it with your updated version.

I've created a service.xml for each of my portlets that require custom db access and some that have no db access - just soap/http calls.

...Dave
thumbnail
Joel Kozikowski,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Expert 帖子: 405 加入日期: 06-6-28 最近的帖子
Joel Kozikowski:
I'm trying to get something a little more "lightweight". I think my approach will be to use Spring Remoting - Http Invoker specifically, to call the Spring exposed versions of the Liferay code. It looks like all of the server side code and definitions are in place. I'll simply need to hand code the client side Spring definitions (which is fairly simple: Google for information re: Spring's HttpInvokerProxyFactoryBean).

SUCCESS!

I'm about to leave town on a biz trip, but I'm finally making service calls into my custom Portal services using Spring Remoting. I'll write up a detailed WIKI entry later, but for those who need the info NOW, here are the key points:

1) The Spring definitions for your custom services are created in the file remoting-servlet-ext.xml. This file is automatically generated by ServiceBuilder, and is placed in the /ext/ext-web/docroot/WEB-INF directory. This file, when deployed (in Tomcat at least) is INCORRECTLY placed in webapps/ROOT/WEB-INF. It SHOULD be placed in webapps/tunnel-web/WEB-INF

2) Client side, create a bean definition using Spring's HttpInvokerProxyFactoryBean for your service interface. The URL you want to use is:

http://www.myportal.com/tunnel-web/secure/spring/com_mycompany_MyCustomService-http

The exact part that follows the "secure/spring" part is the same bean def found in your remoting-servlet-ext.xml file.

3) You need to use a custom HttpInvokerRequestExecutor for your Spring invoker - one that is capable of doing HTTP BASIC authentication. You can search the web (and/or Spring forums) on how to do Spring remoting using authentication, or you can wait for my Wiki entry (where I'll post some code from an authenticating invoker I had written last year).

4) The password you pass in needs to be the Liferay Encrypted password, and not the plain text password. You can find that password by searching the User table in your lportal database.

That's all for now. Details will follow.
thumbnail
Joel Kozikowski,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Expert 帖子: 405 加入日期: 06-6-28 最近的帖子
Leaving a few more breadcrumbs (as I've finally deployed my final code to my main server, and my client to a differnt remote machine):

The /ext/ext-ejb/classes/portal-ext.properties file needs to "allow" the IP address of the remote client so the calls will get through the security filter. For Spring Remoting, the two settings of interest are:


spring.remoting.servlet.hosts.allowed
spring.remoting.servlet.https.required


There are similar "hosts.allowed" and "https.required" entries for SOAP, Tunneling, Burlap, etc. See the /portal/portal-ejb/classes/portal.properties file for more details.

Finally, if you get some type of error re: there being no Hibernate session, note that it appears that the wiring of the service objects puts the transaction manager in the "LocalServiceImpl" code, and not the "ServiceImpl" code. What this means is that the transaction is not opened up (and thus no Hibernate Session is created) until you call the Local service.

The design pattern, then, appears to be:

1) Create your remote interface (to be called by your remote client), in your MyEntityServiceImpl before running ServiceBuilder. That will expose the interface to the outside world.

2) Have your implementation of MyEntityServiceImpl simply call a similar method you should create in your MyEntittyLocalServiceImpl. Call that method using MyEntityLocalServiceUtil.

I had some code in the implementation of MyEntityServiceImpl that directly accessed the persisetnce layer (i.e. MyEntityUtil), and that caused some issues once I really made the Spring Remote call (no transaction was active, and thus no Hibernate session). By moving that code to the "LocalService", it solved everything. I traced somewhat through the Spring configuration files and noticed the transaction managers were set up there, so I guess that is how it has to be.

Normally, the transaction is opened when invocation arrives at the remote service layer. In the past, I've used the "OpenSessionInView" Spring servlet filter to handle that. I tried that briefly, but got an error re: the Liferay WebAppContext not being a Spring WebAppContext (which is not true, so I think it was a class loader issue). In any event, I don't have time to mess with it, and it now works with the code in the "LocalService" layer, so I'll leave it at that!
thumbnail
Joel Kozikowski,修改在17 年前。

RE: Remote calls to Services from external apps (via Soap, Tunneling, etc.)

Expert 帖子: 405 加入日期: 06-6-28 最近的帖子
Joel Kozikowski:
Finally, if you get some type of error re: there being no Hibernate session, note that it appears that the wiring of the service objects puts the transaction manager in the "LocalServiceImpl" code, and not the "ServiceImpl" code.


A little more digging, and I now believe this behavior is a bug. See LEP-2408 for details.