In our Flex enviroment we are using a mvc framework from adobe called Cairngorm. In carngorm the services are configured in Services.mxml like this:
In normal the Service is defined in remoting-config.xml:Code:<?xml version="1.0" encoding="utf-8"?> <cairngorm:ServiceLocator xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:cairngorm="com.adobe.cairngorm.business.*"> <!-- Login Service --> <mx:RemoteObject id="person" showBusyCursor="true" destination="person"> <mx:method name="create"/> <mx:method name="save"/> <mx:method name="remove"/> <mx:method name="findByUserName"/> <mx:method name="findIdByUserName"/> <mx:method name="findByLastName"/> <mx:method name="findCoachAthlets"/> <mx:method name="findCoaches"/> <mx:method name="findByEmail"/> <mx:method name="getAll"/> </mx:RemoteObject> </cairngorm:ServiceLocator>
The example app in the spring-flex distribution shows us to empty the remoteing-config.xml. Then I configured the web-application-config.xml like this:Code:<?xml version="1.0" encoding="UTF-8"?> <service id="remoting-service" class="flex.messaging.services.RemotingService"> <adapters> <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/> </adapters> <default-channels> <channel ref="my-amf"/> </default-channels> <destination id="person"> <properties> <factory>spring</factory> <source>person</source> </properties> </destination> </service>
bean with id=person refers to my personDao in my backend. As I understand the documentation id=person is my service tho wich flex refer the methods for the application.Code:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> <!-- Includes Backend context --> <import resource="classpath:/com/globalfoxsystems/trainingguide/core/config/application-context.xml" /> <!-- Maps request paths at /messagebroker to the BlazeDS MessageBroker --> <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <value> /messagebroker/*=mySpringManagedMessageBroker </value> </property> </bean> <!-- Dispatches requests mapped to a MessageBroker --> <bean class="org.springframework.flex.messaging.servlet.MessageBrokerHandlerAdapter"/> <!-- Bootstraps and exposes the BlazeDS MessageBroker --> <bean id="mySpringManagedMessageBroker" class="org.springframework.flex.messaging.MessageBrokerFactoryBean" /> <!-- Expose the productService bean for BlazeDS remoting --> <bean id="person" class="org.springframework.flex.messaging.remoting.FlexRemotingServiceExporter"> <property name="messageBroker" ref="mySpringManagedMessageBroker"/> <property name="service" ref="personDao"/> </bean> </beans>
But I can not access to the remote service. Starting Tomcat show me no errors. I can not understan, why it not work or I missunderstood the spring-flex enviroment.
Thank you for your help in advance!


Reply With Quote
