There are a variety of objects in flex that can be used to interact with the server, including Urlloader, Httpservice, WebService, Remotingobject, Socket,netconnection, and so on:
1,urlloader and Httpservice a variety of loading loaded static text files.
2,webservice is based on SOAP protocol, although the efficiency is not remoting, but the portability is good, and platform, language completely solution lotus root.
3,remoting uses AMF communication protocol, which is considered to be 10 times times more efficient than webservive. At present, there are a variety of mature service-side framework to choose from. NET has fluorinefx,php have Amfphp,java have blazeds. Weborb also has versions that support multiple languages, like PureMVC. Python, Ruby, and so on, also implement AMF.
Regardless of the server-side language used, remoting is a unified configuration. With the implementation of AMF communication protocols in multiple languages at present, porting is no longer a problem. Therefore, remoting should be the best way for flex to interact with the server side at the moment.
One, using Weborb in Google Apps
In that case, I'd like to modify my Hello World program to interact with the server with remoting. I use Weborb as Remoting server, the configuration steps are as follows:
1, download build of Weborb for Google APP engine unzip to anywhere
2, the web-inf/classes directory of two files weborb-acl.xml, weborb-config.xml Copy to the GAPP_FLEXBLOG/SRC directory
3, copy the three jar files in the Web-inf/lib directory to the War/web-inf/lib directory
4, copy the Web-inf/flex directory directly to the War/web-inf directory
5, the contents of the Web-inf/web.xml and war/web-inf/web.xml for the merge, after the completion of the following:
<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE Web-app
Public "-//sun Microsystems, INC.//DTD Web application 2.3//en"
"Http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<!–parameter used by the ActiveMQ broker initializer. The parameter
Contains the path to start the broker on–>
<context-param>
<param-name>ActiveMQBrokerPath</param-name>
<param-value>tcp://localhost:61616?trace=true</param-value>
</context-param>
<filter>
<filter-name>fileuploadfilter</filter-name>
<filter-class>weborb.util.upload.MultiPartFilter</filter-class>
<init-param>
<param-name>deleteFiles</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>fileuploadfilter</filter-name>
<url-pattern>*.wo</url-pattern>
</filter-mapping>
<listener>
<listener-class>weborb.thirdparty.ActiveMQStarter</listener-class>
</listener>
<listener>
<listener-class>weborb. Orbservletcontextlistener</listener-class>
</listener>
<!–Servlets–>
<servlet>
<servlet-name>greetServlet</servlet-name>
<servlet-class>sban.flexblog.server.GreetingServiceImpl</servlet-class>
</servlet>
<servlet>
<servlet-name>helloWorld</servlet-name>
<servlet-class>sban.flexblog.server.HelloWorldServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>weborb</servlet-name>
<servlet-class>weborb. Orbservlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>
<servlet>
<servlet-name>download</servlet-name>
<servlet-class>weborb. Downloadservlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>download</servlet-name>
<url-pattern>/codegen.wo</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>weborb</servlet-name>
<url-pattern>*.wo</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>greetServlet</servlet-name>
<url-pattern>/gapp_flexblog/greet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>helloWorld</servlet-name>
<url-pattern>/gapp_flexblog/hello</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
Welcome-file-list is a list of welcome pages.