事情的原委是:Xcelsius生成的Flash 需要访问BW数据的。 但是Flash文件 本身是存放在一个域(比如),而BW存在另外一个不同的域中() . 而这种访问需要经过一定的认证。
SWF首先会检查YYYY服务器目录下是否有 crossdomain.xml文件,如果没有,则访问不成功;
若crossdomain.xml文件存在,且里边设置了允许域 访问,那么通信正常。
所以我们系统通过一个程序去生成这个文件,从而允许数据访问。
附录:
*&---------------------------------------------------------------------*
*& Report ZCROSSDOMAIN
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
report zcrossdomain.
"---------------------------------------------------------------------------------------
"Create the Crossdomain.xml
"---------------------------------------------------------------------------------------
data crossdomainxml_t type string.
data crossdomainxml type xstring.
concatenate
''
'
'xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFile.xsd">'
'
"'
'
'
into crossdomainxml_t separated by space.
"convert to binary
call function 'SCMS_STRING_TO_XSTRING'
exporting
text = crossdomainxml_t
importing
buffer = crossdomainxml
.
"----------------------------------------------------------------------------------------
" Create Response object with the crossdomain data
"----------------------------------------------------------------------------------------
data lr_cached_response type ref to if_http_response.
create object lr_cached_response type cl_http_response exporting add_c_msg = 1.
lr_cached_response->set_data( crossdomainxml ).
lr_cached_response->set_content_type( 'text/xml' ).
lr_cached_response->set_status( code = 200 reason = 'OK' ).
"set the validity for more than a day(86400)
lr_cached_response->server_cache_expire_rel( expires_rel = 90000 ).
"----------------------------------------------------------------------------------------
"Upload to the ICM root directory
"----------------------------------------------------------------------------------------
call method cl_http_server=>server_cache_upload
exporting
url = '/crossdomain.xml'
response = lr_cached_response
scope = ihttp_inv_global
.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/554557/viewspace-710985/ ,如需转载,请注明出处,否则将追究法律责任。