Apache flex RemoteObject-跨域问题

Apache flex RemoteObject-跨域问题,apache-flex,xml-rpc,Apache Flex,Xml Rpc,我试图从我的服务器获取数据,使用RemoteObject来完成。 当我在本地主机上运行应用程序时,它工作得很好,但是当我在服务器上使用它时,我得到一个Channel.Security.Error(访问URL时出现安全错误) 在服务器端日志中提到了跨域。 77.127.194.4---[23/Oct/2008 21:15:11]“GET/crossdomain.xml HTTP/1.1”501 有人遇到过同样的问题吗?有什么想法吗?您是否尝试将以下内容添加到您的crossdomain.xml(从中

我试图从我的服务器获取数据,使用RemoteObject来完成。 当我在本地主机上运行应用程序时,它工作得很好,但是当我在服务器上使用它时,我得到一个Channel.Security.Error(访问URL时出现安全错误)

在服务器端日志中提到了跨域。 77.127.194.4---[23/Oct/2008 21:15:11]“GET/crossdomain.xml HTTP/1.1”501


有人遇到过同样的问题吗?有什么想法吗?

您是否尝试将以下内容添加到您的crossdomain.xml(从中获取内容):


capslock中的内容可能需要更改以适应您的框架。例如,我从macromedia flash中复制了它。我通常用“www.macromedia.com/xml/dtds/”代替“www.YOUR\u FRAME\u WORK\u CROSSDOMAIN\u POLICY.com/…”


我不确定,但尝试调查一下,这可能是您的问题。对于跨域,您通常需要添加到服务器端,您的内容来自服务器端,允许其他站点获取它。

我找到了解决方案。关于crossdomain.xml文件,您是对的,但不幸的是,Python SimpleXMLRPCServer库不支持默认情况下,移植GET方法,因此我们需要实现它

from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler

class ExtendedXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
  def do_GET(self):
    #only allow a request for the crossdomain file
    if self.path != '/crossdomain.xml':
      self.send_response(403)
      self.log_request(403)
      return

    #open the crossdomain file and read its contents
    response = open('crossdomain.xml', 'r').read()

    #write the data to the socket along with valid HTTP headers
    self.send_response(200)
    self.send_header("Content-type", "text/xml")
    self.send_header("Content-length", str(len(response)))
    self.end_headers()
    self.wfile.write(response)
    self.log_request(200)
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler

class ExtendedXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
  def do_GET(self):
    #only allow a request for the crossdomain file
    if self.path != '/crossdomain.xml':
      self.send_response(403)
      self.log_request(403)
      return

    #open the crossdomain file and read its contents
    response = open('crossdomain.xml', 'r').read()

    #write the data to the socket along with valid HTTP headers
    self.send_response(200)
    self.send_header("Content-type", "text/xml")
    self.send_header("Content-length", str(len(response)))
    self.end_headers()
    self.wfile.write(response)
    self.log_request(200)