Announcement Announcement Module
Collapse
No announcement yet.
flash builder 4 + blazeDS 4.0.0.14931 remoteObject over SSL Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • flash builder 4 + blazeDS 4.0.0.14931 remoteObject over SSL

    I am trying to use remoteObject over amfsecure channel running on https with no authentications. On flash client side, I am using Flash Builder 4 with Flex SDK 4.1. After imported the self-signed certificates into cacerts in Flash Builder install, I could configure Window/Preferences/Adobe/RDS Configuration to point to the web app running on SSL and test connection was successful.
    When hit on https://mymachine/myApp/messagebroker/amfsecure in browser, my app log file indicated that a request was received. But when trying to connect my flash project data/services through BlazeDS, I got RDS 404 error with reason as Not Found. Flex server is set to https://mymachine/myApp and context root is /myApp.

    web.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app>  
    
      <!-- Spring security -->
      <filter>
          <filter-name>springSecurityFilterChain</filter-name>
          <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
      </filter>
      <filter-mapping>
          <filter-name>springSecurityFilterChain</filter-name>
          <url-pattern>/*</url-pattern>
      </filter-mapping>
     
      <!-- Spring configuration -->
      <context-param>
          <param-name>contextConfigLocation</param-name>
          <param-value>
              /WEB-INF/spring/*-config.xml
          </param-value>
      </context-param>
      <listener>
    	  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>  
     
      <servlet>
    	    <servlet-name>myApp</servlet-name>
    	    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    	    <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
    	    <servlet-name>myApp</servlet-name>
    	    <url-pattern>/messagebroker/*</url-pattern>
      </servlet-mapping>
     
      <servlet>
    	    <servlet-name>spring-mvc</servlet-name>
    	    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    	    <load-on-startup>1</load-on-startup>
      </servlet>	
      <servlet-mapping>
    	    <servlet-name>spring-mvc</servlet-name>
    	    <url-pattern>/spring/*</url-pattern>
      </servlet-mapping> 
      <servlet>
          <servlet-name>RDSDispatchServlet</servlet-name>
          <servlet-class>flex.rds.server.servlet.FrontEndServlet</servlet-class>
    	  <init-param>
    	      <param-name>useAppserverSecurity</param-name>
    	      <param-value>false</param-value>
    	  </init-param>
    	  <init-param>
    	      <param-name>messageBrokerId</param-name>
    	      <param-value>_messageBroker</param-value>
    	  </init-param> 
    	  <load-on-startup>10</load-on-startup>
      </servlet>
      <servlet-mapping id="RDS_DISPATCH_MAPPING">
          <servlet-name>RDSDispatchServlet</servlet-name>
          <url-pattern>/CFIDE/main/ide.cfm</url-pattern>
      </servlet-mapping>
     
      <welcome-file-list>
    	<welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
     
    </web-app>
    flex/services-config.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
    
        <services>
            <default-channels>
               <channel ref="my-secure-amf"/>
            </default-channels>
            <service-include file-path="remoting-config.xml" />
        </services>
    
        <channels>
            <channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel">
                <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
            </channel-definition>
        
            <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
                <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
                <properties>
                    <polling-enabled>false</polling-enabled>
                    <add-no-cache-headers>false</add-no-cache-headers>
                </properties>
            </channel-definition>
    
            <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
                <endpoint url="https://{server.name}:443/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
                <properties>
                	<add-no-cache-headers>false</add-no-cache-headers>
                </properties>
            </channel-definition>
    
            <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
                <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
                <properties>
                    <polling-enabled>true</polling-enabled>
                    <polling-interval-seconds>4</polling-interval-seconds>
                </properties>
            </channel-definition>
    
            <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
                <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
            </channel-definition>
    
            <channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
                <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
                <properties>
                	<add-no-cache-headers>false</add-no-cache-headers>
                </properties>
            </channel-definition>
        </channels>
    
        <logging>
            <target class="flex.messaging.log.ConsoleTarget" level="Debug">
                <properties>
                    <prefix>[BlazeDS] </prefix>
                    <includeDate>false</includeDate>
                    <includeTime>false</includeTime>
                    <includeLevel>false</includeLevel>
                    <includeCategory>false</includeCategory>
                </properties>
                <filters>
                    <pattern>Endpoint.*</pattern>
                    <pattern>Service.*</pattern>
                    <pattern>Configuration</pattern>
                </filters>
            </target>
        </logging>
     
        <security>
        	<security-constraint id="trusted">
                <roles>
                    <role>ROLE_ANONYMOUS</role>
                    <role>ROLE_USER</role>
                    <role>ROLE_ADMIN</role>
                </roles>
            </security-constraint>
        </security>
    
        <system>
            <redeploy>
                <enabled>false</enabled>
            </redeploy>
        </system>
    
    </services-config>
    flex/remoting-config.xml
    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-secure-amf"/>
        </default-channels>
    
    </service>
    spring/app-config.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:flex="http://www.springframework.org/schema/flex"
    	xmlns:mvc="http://www.springframework.org/schema/mvc"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:security="http://www.springframework.org/schema/security"
    	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://www.springframework.org/schema/flex 
    		http://www.springframework.org/schema/flex/spring-flex-1.5.xsd
    		http://www.springframework.org/schema/mvc 
    		http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
    		http://www.springframework.org/schema/security
    		http://www.springframework.org/schema/security/spring-security-3.0.xsd">
    
    	<!-- Flex-specific Configuration -->
    	<flex:message-broker id="_messageBroker">
     	    <flex:message-service default-channels="my-secure-amf"/>   
     	    <flex:secured/> <!-- this element must be after message-service -->
    	</flex:message-broker>
    	
    	<security:global-method-security secured-annotations="enabled"/>
    	<security:http auto-config="true">
    	    <security:anonymous enabled="true"/>
    	    <security:intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY" requires-channel="https"/>
    	</security:http>
    	
            <!--this is a dummy provider supports AnonymousAuthenticationToken. There may be better way to achieve no authentication..... -->
    	<bean id="myAuthenticationProvider" class="com.abc.MyAuthenticationProvider"/>
    	
    	<security:authentication-manager>
    	    <security:authentication-provider ref="myAuthenticationProvider" />
    	</security:authentication-manager>
    			
        <bean id="myReportService" class="com.abc.myReportServiceImpl">
           <flex:remoting-destination include-methods="method1, method2"  exclude-methods="method3"/>
        </bean>
    
        <!-- MessageTemplate makes it easy to publish messages -->
        <bean id="defaultMessageTemplate" class="org.springframework.flex.messaging.MessageTemplate" />   
           	
    </beans>
    Both myApp-servlet.xml and spring-mvc-servlet.xml are empty.
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:context="http://www.springframework.org/schema/context"
     
    	xmlns:mvc="http://www.springframework.org/schema/mvc"
    	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-3.0.xsd
    		http://www.springframework.org/schema/context 
    		http://www.springframework.org/schema/context/spring-context-3.0.xsd">
    		
    </beans>

    Thanks in advance!
Working...
X