c# - Microsoft azure service bus api - How to add AutoDeleteOnIdle on subscription description
问题描述
I am trying to make a small library that uses service bus API client. I followed this tutorial for achieving this goal and I manage to do almost every thing I needed except one thing, add AutoDeleteOnIdle property for newly created subscriptions.
Thing is, on the tutorial, the author uses xml body to send to the API and it works well, but I want to add inside the xlm SubscriptionDescription the property AutoDeleteOnIdle, but I keep receiving bad request with the response «The specified resource description is invalid».
I attempted to search on the net about this xml structure and how to find it.. But I can't find any doc!! Even if I check the shema specified in the xml, I get redirected to an unexisting page (for http://schemas.microsoft.com/netservices/2010/10/servicebus/connect).
I am using Microsoft.Azure.ServiceBus v.3.4.0 NuGet, visual studio 2017.
This is the subscription description I've been trying to add AutoDeleteOnIdle property.
Encoding.UTF8.GetBytes("<entry xmlns='http://www.w3.org/2005/Atom'><content type='application/xml'>"
+ "<SubscriptionDescription xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\">"
+ "</SubscriptionDescription></content></entry>");
The code is on this page: https://code.msdn.microsoft.com/Service-Bus-HTTP-client-fe7da74a
Thank you for your help,
Phil
解决方案
I found out what was the problem, I didn't know that I needed to type a special format XSD dates for xml body.
I was adding <AutoDeleteOnIdle>00:10:00</AutoDeleteOnIdle>
because the doc says that they need a ISO format, but it was actually:
<AutoDeleteOnIdle>PT10M</AutoDeleteOnIdle>
I should have sent.
推荐阅读
- javascript - 我正在处理 JavaScript 日期,我坚持将月份转换为周开始日期和结束日期
- c++ - 在 VSCODE 上打开/更新 CGI 文件(用 C++ 编写)
- azure - 已达到表单识别器用户的限制?
- javascript - javascript有没有办法确定以前的浏览器历史记录项是否在我的域中?
- search - 递归查找具有特定文件扩展名和内容的文件
- recursion - 如何在 django rest API 中将一个简单的函数更改为递归函数
- linux - 使用 execvp 将命令行参数读取为命令错误
- wix - Wix 自定义对话框错误:ICE03:不是有效的外键 Visual Studio 2019
- ios - 如何在 Ax DevTools 中添加全局标签(证明)
- deep-learning - 挥发性物质已被移除,现在没有效果。改用`with torch.no_grad():`