简体   繁体   中英

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.

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