Microsoft azure service bus api - How to add AutoDeleteOnIdle on subscription description - c#

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.

Related

C# Autodesk Forge library generates "Source File" attribute for every element

We need to compare 2 versions of the same model in Autodesk Forge web viewer. Both 2D and 3D models, and in different formats (IFC, DWG, Revit, ...). The DiffTool extension works mostly fine, but there is a problem.
We are using the Autodesk.Forge C# library based on this example, but it is generating a "Source File" attribute for every element in the model.
This then is marked as change in every element during the comparison, which is not wanted.
I managed to track down where the attribute is coming from, and it is this line, namely the second attribute of the UploadObjectAsync function:
uploadedObj = await objects.UploadObjectAsync(input.bucketKey,
/* here -> */ Path.GetFileName(input.fileToUpload.FileName), (int)streamReader.BaseStream.Length, streamReader.BaseStream,
"application/octet-stream");
I tried to override the parameter and set it to a fixed value. That way, the "Source File" attribute would be the same and would not show as a change. But that didn't work, since the attribute is "object id", setting it to a same value as a previous model caused the new model to override the old. So even if I used the old URN, I would see the new model.
So, is there any way to solve it? Do I have abandon this C# library and do the REST API calls manually with curl or something? How to solve this?
This is nothing related to the .NET (C#) client SDK. If you submit the translation job with the direct REST API calls to Forge Model Derivative API or other client API written in different programming languages, you will still see the same property shown for IFC files.
Are you loading this model in the SVF2 format? It looks like a known issue, LMV-6829, was logged by our engineering team and reported by my colleague Petr. Our engineering team is investigating the possible solution for the Diff extension. Sorry for the inconvenience!

Update an envelope property to signify It has been downloaded

We want to update an envelope property to signify It has been downloaded by our application at least once before. What is the best practice for that? I tried to use a custom field for that purpose but since custom fields can't be updated once the envelopes are completed is not a feasible option, is there a way to add a custom status to the envelopes?
Another option is to store the last date we downloaded envelopes and start downloading from that date the next time, but it's not ideal.
Thank you for reaching out.
When do you need to download the document exactly? I presume you only want to download the documents when the envelope is complete (and you're looking to set a flag somewhere to indicate that documents are downloaded).
In that case, I would suggest you look into DocuSign connect (https://developers.docusign.com/platform/webhooks/connect/)
When the completed event comes in, you can go ahead and download the documents. You don't need to set a flag anywhere as the event is fired only once when the envelope is complete.
If flagging the download is a strict requirement for some reason, then you can look into setting up DocuSign Connect with a queueing system such as Azure service bus or other cloud provider equivalents ( https://github.com/docusign/connect-node-listener-azure). In this case, if the queue pointer is pointing to the next completion event where documents need to be download. Anything prior is already downloaded.

Microsoft Graph Schema Registration

I am working on creating a simple calendar app to track the user's Outlook.com calendar. In order to add some custom information I am needing to use Schema Extension as this information must be filterable and to my knowledge there is no filterable on Open Extension data.
I have followed the RegisterSchemaExtension() from the following sample: https://github.com/microsoftgraph/uwp-csharp-snippets-rest-sample/blob/master/O365-UWP-Unified-API-Snippets/Extensions/ExtensionSnippets.cs
and have added the proper scope to my application. I have also added the Directory.AccessAsUser.All permission to my app through the app registration portal at: https://apps.dev.microsoft.com/portal/register-app
Despite this, I am unable to register the schema and get error saying: MethodNotAllowed. I am not sure where to go from here as I haven't been able to find useful resources on the web. Apologies for the English! It is not perfect yet but I am learning!
With how complicated the Schema Extension turned out I decided to use Open Extension and do filtering manually.

Updating an Evernote Note from HTML

Using the C# SDK I'm working on a simple application to load a note from evernote, allow the user to edit the note using a HTML wysiwyg editor and then save it back to Evernote.
I'm a little confused. I can load a ENNote from the standard ENSession and access the HTML version of the note, but to update I have to load a Edam.Type.Note which has no HTML properties to set just the standard XML doc.
I can see there is a ENHTMLtoENMLConverter class but its internal? Its counterpart ENMLtoHTMLConverter is public.
Is there an easy to convert basic HTML/ENHTML into a Edam.Type.Note so I can update without writing my own converter or compiling my own version of the SDK?
Creating a note using HTML or web content
The SDK contains a facility for supplying HTML or web content to a
note.
ENNote myFancyNote = new ENNote();
myFancyNote.Title = "My first note";
myFancyNote.Content = ENNoteContent.NoteContentWithSanitizedHTML("<p>Hello, world - <i>this</i> is a <b>fancy</b> note.</p>");
ENNoteRef myFancyNoteRef = ENSession.SharedSession.UploadNote(myFancyNote, null);
This method handles general HTML content, including external style
sheets which it will automatically inline. Please note that this is
not a comprehensive "web clipper", though, and isn't designed to work
fully on all arbitrary pages from the internet. It will work best on
pages which have been generally designed for the purpose of being
captured as note content.
Source : Getting Started with the Evernote Cloud SDK for Windows
You can do this without dipping into the "advanced" stuff. You still want to call ENSession.SharedSession.UploadNote but use the version that lets you specify one of the "replace" policies as appropriate:
public ENNoteRef UploadNote(ENNote note, ENSession.UploadPolicy policy, ENNotebook notebook, ENNoteRef noteToReplace)
You'll still need to create an ENNote with your updated content (you can use the NoteContentWithSanitizedHTML etc). And supply the note ref pointing to the original note you want to replace.

AssetUrlSelector toolpart

What I need to do is quite simple although is causing me lots of trouble.
I need to create programmatically an AssetUrlSelector in a web part that selects a file in sharepoint 2010 and makes its path available to be used elsewhere.
So far I have managed to create the AssetUrlSelector and display the path on a textbox, however I cannot use this as every reference to it will be null.
Have you got any practical example?
Try the Document ID Service. In short this service generates IDs for documents (files) and generates an url with this ID so even if the file is moved the url stays valid and the service returns the document. This service might rely on search functionality unless you implement your custom search. Here is an article on how to configure OOB Doc IDs here. Also you can google further if you're interested.

Categories