Hello,
I just started using BlazeDS and want to integrate it with Spring framework.
I managed to run an example but still don't understand how it works.
Questions:
1. RemoteObject on client side means that we use AMF?
2. RemoteObject refers to Destination and channel (which is AMF again(?!) and URL). Does it mean we can have several Destinations on one URL? Can we have several Channels in Channel Set where not all Channels are AMF for RemoteObject?
3. Server side defines Service which is composite of Destination, Adapter and Channel. Destination is Java class, Adapter is the way to access Java classes in general (please tell me if I am wrong). What does Service's class mean?
4. And why do we need Channel declaration on server side? From official doc I understand that it is client's abstraction.
5. I am using DispatchServlet from Spring to recieve requests. All requests are transferred to BlazeDS's MessageBroker because of <flex:message-broker/> tag. I'd like to declare BlazeDS's beans in Spring configuration using <flex:remoting-object/> tag. Can someone tell me how to do that using my classes? (I tried to do that but failed)
Thanks a lot.
Here is what I have:
---------------------
excerpt from web.xml:
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:web-application-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>
----------------------
web-application-context.xml for Spring
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:flex="http://www.springframework.org/schema/flex"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schem...-beans-3.0.xsd
http://www.springframework.org/schema/flex
http://www.springframework.org/schema/flex/spring-flex-1.0.xsd">
<flex:message-broker/>
</beans>
----------------------
service-config.xml:
<services-config>
<channels>
<channel-definition id="amfChannel"
class="mx.messaging.channels.AMFChannel">
<endpoint url="http://localhost:8180/server-1.0/messagebroker/amf"
class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
</channels>
<services>
<service id="mapService"
class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.J avaAdapter" default="true"/>
</adapters>
<default-channels>
<channel ref="amfChannel"/>
</default-channels>
<destination id="mapServiceDestination">
<properties>
<source>org.unihistory.server.frontend.blazeds.map .MapService</source>
</properties>
</destination>
</service>
</services>
</services-config>
------------------------
client code:
<fx:Script><![CDATA[
public function test():void {
mapService.sayHello();
}
]]></fx:Script>
<s:layout>
<s:BasicLayout/>
</s:layout>
<fxeclarations>
<s:RemoteObject id="mapService" destination="mapServiceDestination">
<s:channelSet>
<s:ChannelSet id="uniset">
<s:channels>
<s:AMFChannel uri="http://localhost:8180/server-1.0/messagebroker/amf"/>
</s:channels>
</s:ChannelSet>
</s:channelSet>
</s:RemoteObject>
</fxeclarations>
<s:Button label="Say Hello" click="test()"/>


eclarations>
Reply With Quote
). But if you don't like to do annotations on the java code (@Service, @RemoteDestination), you can always do this 