私は、clientaccesspolicy.xml と、私の xap (app.xap 経由でアクセス可能) を指すだけの index.htm を提供する、自己ホスト型の WCF サーバーのセットアップを持っています。
私は現在、次のコードを介してそれらを提供しています:
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 バインディングがあります)
ちゃんと配信されてる?または、いくつかの変更を加える必要がありますか?