我想從Silverlight(4)調用一個Rpc到JBOSS webserver的原型。我編寫了代碼,它正在控制檯應用程序中工作 - 所以我知道Jboss正在響應Web請求。它移植到Silverlight 4中,導致問題出現:Silverlight HttpWebRequest.Create掛在異步塊內
let uri = new Uri(queryUrl)
// this is the line that hangs
let request : HttpWebRequest = downcast WebRequest.Create(uri)
request.Method <- httpMethod;
request.ContentType <- contentType
它可能是一個沙箱的問題,因爲我的Silverlight是正在擔任了我的文件系統和URI是到本地主機的引用 - 雖然我不是連得到一個例外。思考?
THX
更新1
我創建了一個新的項目,並在移植我的代碼,現在它是工作;對於F#Silverlight集成仍然存在一些問題。還是想知道關於調試「掛」在網上的舊模式創建的想法...
更新2
let uri = Uri("http://localhost./portal/main?isSecure=IbongAdarnaNiFranciscoBalagtas")
// this WebRequest.Create works fine
let req : HttpWebRequest = downcast WebRequest.Create(uri)
let Login = async {
let uri = new Uri("http://localhost/portal/main?isSecure=IbongAdarnaNiFranciscoBalagtas")
// code hangs on this WebRequest.Create
let request : HttpWebRequest = downcast WebRequest.Create(uri)
return request
}
Login |> Async.RunSynchronously
我必須失去了一些東西; Async模塊在控制檯應用程序中正常工作 - 是否在Silverlight應用程序中不允許?
是否有這樣的一個更新 - 你得到它的工作... – akaphenom 2010-06-21 15:44:31