XmlDictionaryReader to XML file

XmlDictionaryReader to XML file

H.echeva
Advocate Advocate
719 Views
2 Replies
Message 1 of 3

XmlDictionaryReader to XML file

H.echeva
Advocate
Advocate

Hello all,

 

I am playing around with the Revit Server REST API SDK example. I am slowly understanding how it works.

I understand that you make a request and then you get a response in json format, which we then transform with the XmlDictionaryReader to an xml (is that right?). To continue understanding the SDK example I would like to see how that request looks like in xml format. So far I have tried the following:

  XmlDictionaryReader reader = GetResponse(path + "/contents");
           File.WriteAllText("D:\\xmltest.txt", reader.ReadString());

but this doesn't return anything.

 

Is there a way to export the Request response as an xml? I am very lost in this as I am not used to deal with json or xml programmatically.

 

Many thanks

0 Likes
720 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk

Run your code in the debugger and take a look at the contents and properties of your reader variable.

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 3

H.echeva
Advocate
Advocate

Hello @jeremytammik 

 

Thanks for the suggestion.

 

Unfortunately, I couldn't make this to work. Using the debugger I see a lot of information but couldn't find the xml itself (see image).

I made some research and apparently this is not as easy as using only one method. I think it is necessary to loop through the nodes and export them.

 

2020-02-13_09h21_55.png

0 Likes