我如何_properly_通过自托管WCF服务提供XAP文件?

| 我有一个自我托管的WCF服务器设置,该服务器提供一个clientaccesspolicy.xml和一个index.htm,它仅指向我的xap(可通过app.xap访问)。 我目前正在通过以下代码为他们提供服务:
Public Function GetPolicy() As System.IO.Stream Implements IClientAccessPolicy.GetPolicy

    WebOperationContext.Current.OutgoingResponse.ContentType = \"application/xml\"
    Return New IO.MemoryStream(IO.File.ReadAllBytes(\"Server Files/ClientAccessPolicy.xml\"))

End Function

Public Function GetIndex() As IO.Stream Implements ISilverlightServer.GetIndex

    WebOperationContext.Current.OutgoingResponse.ContentType = \"text/html\"
    Return New IO.MemoryStream(IO.File.ReadAllBytes(\"Server Files/index.htm\"))

End Function

Public Function GetXap() As IO.Stream Implements ISilverlightServer.GetXap

    WebOperationContext.Current.OutgoingResponse.ContentType = \"application/x-silverlight-app\"
    Return New IO.MemoryStream(IO.File.ReadAllBytes(\"Server Files/app.xap\"))

End Function
它有效,可以完成我要处理的工作。但是,我认为这不能正确地流式处理xap,而且我知道它是流式的。如果无法正确流式传输,我应该如何流式传输? (XAP和index.htm文件通过的端点具有webHttpBinding绑定) 是否正确流式传输?还是应该进行一些更改?     
已邀请:
        很好,不需要将XAP文件流式传输到客户端。实际上,它需要首先完全下载(因此在客户端缓存)才能启动SL应用程序,因此在这种情况下,您不必担心流式传输。     

要回复问题请先登录注册