English 中文(简体)
如何在申请完成REST时通知HTTP员额发布方法的打电话者
原标题:How to notify a caller of the HTTP post method upon request completion in REST

我正在执行REST网络服务,我有一个资源(http://localhost/CreativeUndersr),这是一种POST方法,用JSON用户对象。

现在时间t1, 调用者用 JSON 对象调用这个 API 。 我对时间t1 进行基本验证, 并返回响应为 seces full 。

但在我的后端, 这个人创造逻辑需要一段时间才能“真正创造”并持续到数据库中, 这需要一些时间, 例如时间 t2, 用户创建完成 。

现在,我有什么办法通知打电话者这个用户创建者“真的成功”? (或者用户创建者可能在t1和t2之间失败,如何通知这个API的打电话者? 方法是什么? )

我想到的其中一个方式是,为每一项此类请求创建一个请求号码,而打电话者则保持对另一个 " Get API " 的投票,例如(http://localhost/status/requestId),这将给他提出这一请求的结果。

还有什么更好的办法吗?

最佳回答

要么等待用户在返回前“ 真正” 创建, 要么执行类似 GeopUser 的操作..., 它可能有一个“ 创建” 或“ 创建” 的状态字段 。 在我看来, 绘制每个呼叫“ 请求” 似乎都有点像 。

问题回答

暂无回答




相关问题
IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

ASP.net web services

I am using a web service which sets the Thread.CurrentPrincipal object while logging in and soon later when another webmethod of the same web service accesses Thread.CurrentPrincipal, its different/...

Unity Container Disposing and XML Web Service

I am registering some wrapers over un-managed objects in container. How can I dispose of them at the end of the container s lifetime? Please bear in mind I have an XML Web service.

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

热门标签