05-02-2011 01:31 PM
02-15-2012 04:01 PM
02-17-2012 07:12 AM
05-22-2012 07:39 AM
<bean id="yourService" parent="baseJavaScriptExtension"
class="com.yourcompany.alfresco.services.ScriptableYourServiceWrapper">
<property name="extensionName">
<value>yourService</value>
</property>
<property name="yourService" ref="externalServicesClient" />
</bean>
and then, as in my case, use the Apache CXF framework http://cxf.apache.org/ which is built on Spring and provides you more flexibility.public class ScriptableYourServiceWrapper extends BaseScopableProcessorExtension implements YourService{
private yourService yourServiceClient;
… your methods
}
and the YourServiceManager is something like this:public class yourServiceManager implements YourService{
private YourService yourServiceServiceImpl;
public void setYourService(YourService yourServiceClient) {
this.yourServiceServiceImpl = yourServiceClient;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<context:annotation-config />
<jaxws:client id="yourServiceCxfClient"
serviceClass="yourServiceWebServiceSEIClass"
address="${yourServiceWebServiceURL.wsdl.url}" />
<bean id="yourServiceService"
class="yourServiceServiceImpl">
<property name="cxfYourServiceClient" ref="yourServiceCxfClient" />
</bean>
<bean id="externalServicesClient"
class="yourServiceManager">
<property name="yourService" ref="yourServiceService" />
</bean>
</beans>
The stubs for the service are obtained form the WSDL using a WSDL2Java command which gives you the Service Endpoint Interface to set as service class in the serviceClass property into the jaxws xml fragment.yourService.yourMethod()
Hope this helps.Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.