tag:help-archives.hannonhill.com,2010-02-09:/discussions/web-services/1633-question-on-reading-cascade-file-metadata-programmatically-in-cCascade CMS: Discussion 2016-08-15T12:45:16Ztag:help-archives.hannonhill.com,2010-02-09:Comment/403191772016-07-13T19:49:48Z2016-07-13T19:49:48ZQuestion on Reading Cascade file metadata programmatically in C#<div><p>Hi Support Team -</p>
<p>I'm forwarding a question from Slava, one of our developers.</p>
<p>Thanks!</p>
<hr>
<p>Rommel Lagman<br>
Developer, I.T. Development Services<br>
AGF Investments Inc.<br>
Tel: 647-253-6908<br>
Email: <a href="mailto:rommel.lagman@agf.com">rommel.lagman@agf.com</a></p>
<p>From: Slava Naumenko<br>
Sent: July-13-16 2:32 PM<br>
To: Rommel Lagman<br>
Subject: Read Cascade file metadata programmatically in C# ?</p>
<p>Hi Rommel,</p>
<p>I created a project in C# to talk to Cascade web services
referencing /ws/services/AssetOperationService. The reference gave
a presentation of all web methods as objects in C#.</p>
<p>So far I was able to figure out how to create and update folders
and files just using intellisense in Visual Studio and some other
stuff. But I got a bit stuck with dynamic metadata.</p>
<p>This is what I got so far:</p>
<p>// Get Cascade file by id</p>
<p>string id = "e4e67962c0a84b696f983e2f68439e3d";</p>
<p>Cascade.identifier wsCascadeFile = new Cascade.identifier();<br>
wsCascadeFile.path = new Cascade.path();<br>
wsCascadeFile.path.siteName = csSite;<br>
wsCascadeFile.path.path1 = csPath;<br>
wsCascadeFile.type = Cascade.entityTypeString.file;<br>
wsCascadeFile.id = id;</p>
<p>Cascade.readResult fileRead = wsCascade.read(wsCascadeAuth,
wsCascadeFile);</p>
<p>Cascade.file file = fileRead.asset.file;</p>
<p>// Read custom metadata field</p>
<p>string dynamicFieldValue = file.metadata.dynamicFields..... ??
got stuck here</p>
<p>My guess there should be another web service request for
metadata but then how do I get the identifier for that? Or the file
object is already loaded with all metadata? Then how do I get a
specific field?</p>
<p>Do you know a good reference for my case? Examples in Java will
be good too.</p>
<p>Thanks.</p>
<p>Slava</p>
<p>This email message is confidential to the intended recipient and
may be privileged. It is intended solely for the addressee. Access
to this email by anyone else is unauthorized. Any unauthorized use,
dissemination of the information, or copying of this message is
prohibited. If you are not the intended addressee, kindly notify
the sender by return e-mail and delete this message.</p>
<p>Le pr?sent courriel est strictement r?serv? ? l'usage du
destinataire pr?vu. Il peut contenir des renseignements privil?gi?s
et confidentiels. L'acc?s ? ce courriel par une personne autre que
son destinataire est interdit. Il est aussi interdit d'utiliser, de
diss?miner ou de copier ce message sans autorisation. Si vous avez
re?u ce courriel par erreur, veuillez en aviser l'exp?diteur et
d?truire le message.</p></div>rommel.lagmantag:help-archives.hannonhill.com,2010-02-09:Comment/403191772016-08-11T12:46:42Z2016-08-11T12:46:42ZQuestion on Reading Cascade file metadata programmatically in C#<div><p>Hi Slava,</p>
<p>I have never worked with Java or C# when dealing with Cascade
web services. I just want to point out a few things. First,
<code>file.metadata.dynamicFields</code> could be null, or an
object, or an array. So first you need to test if it is null. If it
is not, then test if it is an array of objects. If it is an array,
you need to traverse it. When you are down to an object, look at
the <code>name</code>. If the <code>name</code> matches what you
are looking for, then look at <code>fieldValues</code>. Again, this
can be null, an object, or an array. See <a href="http://www.upstate.edu/cascade-admin/web-services/api/asset-classes/file.php">
http://www.upstate.edu/cascade-admin/web-services/api/asset-classes...</a>
for reference.</p>
<p>Second, you might want to look at my PHP library. Even though
you don't want to use PHP, my library will give you a lot of
pointers and answer most, if not all, of your questions related to
Cascade web services. My documentation site contains even more
information.</p>
<p>Third, you can install MAMP on any computer, deploy my PHP
library, and use it to write ws programs in PHP. There are many
advantages of using my library. It comes with full documentation,
tutorials, tons of examples, and a discussion forum.</p>
<p>Four, I plan to deliver a second series of web service tutorials
on Google Hangout. We will start with the installation of MAMP and
deployment of my library. Let me know if you are interested.</p>
<p>Wing</p></div>Wing Ming Chantag:help-archives.hannonhill.com,2010-02-09:Comment/403191772016-08-11T14:36:11Z2016-08-11T14:36:11ZQuestion on Reading Cascade file metadata programmatically in C#<div><p>Thanks Wing.</p>
<p>I’ve forwarded your reply to Slava.</p>
<p>Warm regards,</p>
<p>R</p></div>rommel.lagmantag:help-archives.hannonhill.com,2010-02-09:Comment/403191772016-08-11T17:11:41Z2016-08-11T17:11:41ZQuestion on Reading Cascade file metadata programmatically in C#<div><p>This was posted in Hannon Hill Users Slack, and I am posting it
here again:</p>
<p>Some quick references:<br>
1. PHP web service library: <a href="https://github.com/wingmingchan/php-cascade-ws-ns">https://github.com/wingmingchan/php-cascade-ws-ns</a><br>
2. Library API documentation: <a href="http://www.upstate.edu/cascade-admin/web-services/api/index.php">http://www.upstate.edu/cascade-admin/web-services/api/index.php</a><br>
3. Tutorials: <a href="http://www.upstate.edu/cascade-admin/web-services/courses/index.php">
http://www.upstate.edu/cascade-admin/web-services/courses/index.php</a><br>
4. Google hangout recordings: <a href="https://www.youtube.com/playlist?list=PLiPcpR6GRx5cGyfQESK6ZAj4My8rJidt4">
https://www.youtube.com/playlist?list=PLiPcpR6GRx5cGyfQESK6ZAj4My8r...</a><br>
5. Examples and recipes: <a href="https://github.com/wingmingchan/php-cascade-ws-ns-examples">https://github.com/wingmingchan/php-cascade-ws-ns-examples</a><br>
6. Cascade Web Services Library Support: <a href="https://groups.google.com/forum/#!forum/cascade-web-services-library-support">
https://groups.google.com/forum/#!forum/cascade-web-services-librar...</a></p></div>Wing Ming Chantag:help-archives.hannonhill.com,2010-02-09:Comment/403191772016-08-11T17:25:10Z2016-08-11T17:25:10ZQuestion on Reading Cascade file metadata programmatically in C#<div><p>Thanks Wing.</p>
<p>Regards,</p>
<p>Rommel</p></div>rommel.lagman