I added added domains to trusted sites...
Well the real problem with this ManagedRuntimeError: System.Security.SecurityException seems to be that the server doesn't have right crossdomain.xml. I should do my own service to wrap the service.

I changed my call to point to localhost and got this working.
The latest code (with installed F# Power Pack to get AsyncReadToEnd) is this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
let mutable callresult = ""
//let event = new Event<string>()
//let eventvalue = event.Publish
 
let internal fetch (url : Uri) = 
    let req = WebRequest.CreateHttp url
    req.CookieContainer <- new CookieContainer()
    let asynccall =
        async{
            try
                let! res = req.AsyncGetResponse() 
                use stream = res.GetResponseStream()
                use reader = new StreamReader(stream)
                let! txt = reader.AsyncReadToEnd()
                //event.Trigger(txt)
                callresult <- txt
            with
                | :? System.Exception as ex -> //for debug
                    failwith(ex.ToString()) 
        }

    asynccall |> Async.StartImmediate
By on 6/1/2011 6:55 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper