[英]How can a WCF Service obtain Query Parameters?
I'm working on an Azure service for a Windows Phone app. 我正在为Windows Phone应用程序开发Azure服务。 I need the Azure Service to access the users' OneDrive.
我需要Azure服务来访问用户的OneDrive。 Following this article , my scenario should be:
在本文之后 ,我的方案应该是:
After investigating a lot in Service, I still can't find a way to capture the query parameter in my web service. 在调查了很多服务后,我仍然找不到在我的Web服务中捕获查询参数的方法。 As I am new to this area, I don't know where to focus on.
由于我是这个领域的新手,我不知道在哪里关注。 I'll be really appreciated if you can give my an advise or answer my following questions:
如果您能提出建议或回答以下问题,我将非常感激:
Thanks! 谢谢!
I'm not sure if i understand your problem properly but if you want your RESTfull WCF service to be the callback receiver for the request code, your Service must be hosted with a WebHttpBinding and a ServiceContract similar to this one. 我不确定我是否正确理解您的问题,但如果您希望RESTfull WCF服务成为请求代码的回调接收器,则您的服务必须使用类似于此的WebHttpBinding和ServiceContract托管。
[ServiceContract]
public interface IService
{
[WebGet(UriTemplate = "callback?code={requestCode}")]
void OAuthCallback(string requestCode);
}
So if the base address of your Service is " http://service.mydomain.com/MyService.svc " the OAuthCallback Method will be called when a http GET request to " http://service.mydomain.com/MyService.svc/callback?code=RequestCode " is made. 因此,如果您的服务的基地址是“ http://service.mydomain.com/MyService.svc ”,则当对“ http://service.mydomain.com/MyService.svc ”的http GET请求时,将调用OAuthCallback方法/ callback?code = RequestCode “。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.