简体   繁体   中英

Does a WCF service run on the UI thread or on the Asynchronous Request thread in Windows Phone 7?

As the question states which thread is used when accessing a WCF service?

Most web services that I have been subscribing to I have used HttpWebRequest because it doesn't block the UI thread. But when I access the Bing API it uses a WCF service. Is this an implementation of WebClient or HttpWebRequest?

From the outside it looks more like WebClient because it does not require you to call BeginInvoke to marshal the data to the UI thread? Is this accurate?

There's no WCF service on a Windows Phone - the API in that platform only contain the code for the client part of WCF (accessing services).

You can not block the UI thread with both HttpWebRequest and WebClient (eg, using BeginGetResponse and DownloadAsync , respectively). If I remember correctly, the WCF client in the phone uses HttpWebRequest internally, but that's an implementation detail, it can be changed at any time. And all WCF calls from the Windows Phone platform (and Silverlight as well) need to be asynchronous (ie, there's no synchronous support).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM