Fórum

Calling web services with Spring without using WSRP

Gergo Feher, modificado 8 Anos atrás.

Calling web services with Spring without using WSRP

New Member Postagens: 22 Data de Entrada: 30/03/15 Postagens Recentes
Hello!

I have a PrimeFaces based portlet (it's my frontend, xhtml pages and beans mostly). I imported another project, it's my service layer, it's not a Liferay plugin project/portlet . I use Spring framework in my application. In this service layer i also have generated classes from wsdl files (it's in my target folder). So my function calls should be like this: my jsf portlet method -> service project -> service call (if there's any).
I try to configure it with Spring, it can inject my Services , but i can't autowire my web service variables, e.g:
@Autowired
private COMMON common;

Error log:
"Injection of autowired dependencies failed; No qualifying bean of type COMMON is defined".

In my server-context.xml (it's in my service project) i have for this some bean definitions, like:
<bean id="commonWebService" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">
<property name="serviceInterface" value="hu.proba.services.common.COMMON"/>
<property name="wsdlDocumentUrl" value="classpath:META-INF/wsdl/Common.wsdl"/>
<property name="endpointAddress" value="${webservices.common.endpointAddress}"/>
<property name="namespaceUri" value="http://proba.hu/services/COMMON/"/>
<property name="serviceName" value="COMMON"/>
<property name="portName" value="COMMONSOAP"/>
<property name="lookupServiceOnStartup" value="false" />
</bean>

Not in Liferay environment this service injection works like that.
My question is that can i do that behaviour with Liferay like this, or do i have to find another solution for this?

Gergo
thumbnail
Philip White, modificado 8 Anos atrás.

moved

Junior Member Postagens: 76 Data de Entrada: 11/03/15 Postagens Recentes
moved to Liferay Faces - English! emoticon

phil
thumbnail
Philip White, modificado 8 Anos atrás.

RE: Calling web services with Spring without using WSRP (Resposta)

Junior Member Postagens: 76 Data de Entrada: 11/03/15 Postagens Recentes
Hello Gergo!

Could you please try our jsf2-spring-portlet.war demo in your environment and let us know if it works?

if it works in your environment, then you can try adding @Autowired type features to our jsf2-spring-portlet to see if you can get it working.

Hope this helps!

Phil
Gergo Feher, modificado 8 Anos atrás.

RE: Calling web services with Spring without using WSRP

New Member Postagens: 22 Data de Entrada: 30/03/15 Postagens Recentes
Hi!

It turned out that i had just a configuration error in my project, so it wasn't a Liferay issue. Thank you for your answer!

Gergo