Development of Flex Blog system from zero based on FLEX4 technology: 3 Use remoting service

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.