INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Kudos - And Web Service Question  (Read 8385 times)

Diverdown1964

  • Regular Member
  • World Citizen
  • ***
  • Posts: 179
  • No matter where you go, there you are
Kudos - And Web Service Question
« on: August 02, 2009, 08:09:16 pm »

It's been a long time since I've posted here, but 14 has prompted it.

I've been using Media Center for a long time...I think since version 8 (Jukebox). I always describe it to people as the best value out there. I don't know how you continue to provide the host of features that you do at the price point that you do. I now manage all of my media from music to photos to movies with it, and it continues to impress.

One thing that I always found lacking was extensibility. THe COM based SDK seemed focused solely on playing features, and I wanted to be be able to expose the collection to other environments. The web services features hold that promise. From the online documentation, I should be able to use the query method to do what I need. However, I have as yet been unable to use Visual Studio to create the appropriate proxy class. What address do I use to access the WSDL?

Thanks, and again, congratulations on an all around excellent product.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72541
  • Where did I put my teeth?
Re: Kudos - And Web Service Question
« Reply #1 on: August 02, 2009, 10:00:50 pm »

Thanks.  With the Web Services Interface, you just start the server, then use a browser to get the docs.

http://wiki.jrmediacenter.com/index.php/Web_Service_Interface
Logged

Diverdown1964

  • Regular Member
  • World Citizen
  • ***
  • Posts: 179
  • No matter where you go, there you are
Re: Kudos - And Web Service Question
« Reply #2 on: August 03, 2009, 06:17:24 am »

Thanks Jim

I actually had gotten that far, but the docs appear to simply list out the available web service methods. I'm having trouble finding the address of the WSDL.

Cheers
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72541
  • Where did I put my teeth?
Re: Kudos - And Web Service Question
« Reply #3 on: August 03, 2009, 06:30:16 am »

Did you try what I suggested above, with your browser?  The IP address is the one where you're running Library Server.

The response is the WSDL.  You can read about this method here:
http://www.w3.org/TR/wsdl

It gives you the list of commands you can use.
Logged

Diverdown1964

  • Regular Member
  • World Citizen
  • ***
  • Posts: 179
  • No matter where you go, there you are
Re: Kudos - And Web Service Question
« Reply #4 on: August 03, 2009, 06:46:08 am »

I did. That URL returns an HTML doc, where I was expecting XML. I hacked around a little and saw what I thought I was after at http://<machine>/MCWS/v1/wsdl. Unfortunately, VIsual Studio doesn't seem to recognize it as valid when adding a web reference to a project.

Cheers
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72541
  • Where did I put my teeth?
Re: Kudos - And Web Service Question
« Reply #5 on: August 03, 2009, 06:54:35 am »

Each command in the WISDL you should see (portion below) is documented, with examples.  Try the "Click Here". 

To use in another program, I believe you only need to be able to send an HTML command on the correct port.



List of functions

   Playback

      Pause
         Set the pause state.
         Parameters:
            State: The new pause state (0: unpaused, 1: paused, -1: toggle) (default: -1)
            Zone: The zone the command is targetted for. (default: -1)
            ZoneType: The type of value provided in 'Zone' (id: zone id; index: zone index; name: zone name (default: id)
         Response:
         Examples:
            Click here

      Next
         Advance to the next track.
         Parameters:
            Zone: The zone the command is targetted for. (default: -1)
            ZoneType: The type of value provided in 'Zone' (id: zone id; index: zone index; name: zone name (default: id)
         Response:
         Examples:
            Click here

      Previous
         Advance to the previous track.
         Parameters:
            Zone: The zone the command is targetted for. (default: -1)
            ZoneType: The type of value provided in 'Zone' (id: zone id; index: zone index; name: zone name (default: id)
         Response:
         Examples:
            Click here

....

Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72541
  • Where did I put my teeth?
Re: Kudos - And Web Service Question
« Reply #6 on: August 03, 2009, 07:00:29 am »

... I hacked around a little and saw what I thought I was after at http://<machine>/MCWS/v1/wsdl. Unfortunately, VIsual Studio doesn't seem to recognize it as valid when adding a web reference to a project.
Should be in this form:

http://localhost/MCWS/v1/doc
or
http://<ip address or machine name>/MCWS/v1/doc
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42442
  • Shoes gone again!
Re: Kudos - And Web Service Question
« Reply #7 on: August 03, 2009, 10:21:31 am »

We are using a REST interface, which is a little more straight-forward than a full SOAP interface.  It makes returning binary objects (like a piece of cover art) easier.

Because of this, we have to use WSDL 2.0 since WSDL 1.0 doesn't support REST.

The bad news is that Microsoft .NET doesn't support WSDL 2.0.

Hopefully it won't be too hard to make your own REST wrapper or find someone else's for the .NET environment.
Logged
Matt Ashland, JRiver Media Center

Diverdown1964

  • Regular Member
  • World Citizen
  • ***
  • Posts: 179
  • No matter where you go, there you are
Re: Kudos - And Web Service Question
« Reply #8 on: August 03, 2009, 12:45:40 pm »

Thanks guys. Got it. I was missing the REST piece - haven't worked with it before. I'll dig a little over the next little while and see what I come up with. Whatever it is, I'll share with the community. In the short term, here's a link thaqt talks about using REST services with the MS Development tools.

http://msdn.microsoft.com/en-ca/netframework/dd547388.aspx

Turns out that there's a VS add in that helps support it.

I'll be primarily interested in database info with what I'm doing, not so much remote control. I'll pass on any requests once I start getting my feet wet.

Thanks again for this!
Logged

Diverdown1964

  • Regular Member
  • World Citizen
  • ***
  • Posts: 179
  • No matter where you go, there you are
Re: Kudos - And Web Service Question
« Reply #9 on: August 03, 2009, 12:52:31 pm »

One more quick question. What is the syntax of the query method? Let's say I'd like to find all tracks in my library by the band Boston. I would think that I would use the URL:

http://<servername>/MCWS/v1/Files/Search&Query=Boston

but doing that results in:

 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
  <rsp stat="fail">Function 'Files/Search&Query=Boston' not found.</rsp>

What am I missing?

Thanks
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42442
  • Shoes gone again!
Re: Kudos - And Web Service Question
« Reply #10 on: August 03, 2009, 01:11:34 pm »

One more quick question. What is the syntax of the query method? Let's say I'd like to find all tracks in my library by the band Boston. I would think that I would use the URL:

http://<servername>/MCWS/v1/Files/Search&Query=Boston

but doing that results in:

 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
  <rsp stat="fail">Function 'Files/Search&Query=Boston' not found.</rsp>

What am I missing?

Thanks

Try this:
http://localhost/MCWS/v1/Files/Search?Query=Boston&Output=mpl

Also, remember that we're still building this interface out, so just request functions as you need them.

Thanks.
Logged
Matt Ashland, JRiver Media Center

Diverdown1964

  • Regular Member
  • World Citizen
  • ***
  • Posts: 179
  • No matter where you go, there you are
Re: Kudos - And Web Service Question
« Reply #11 on: August 03, 2009, 01:38:08 pm »

Perfect - that works!

Now - is there any way that I can search on a specific library field? If so, I'd like to be able to differentiate "Boston" from "Boston Pops", etc....

Thanks
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3123
Re: Kudos - And Web Service Question
« Reply #12 on: August 13, 2009, 04:25:57 pm »

Do you guys have any plans to extend this to support ViewItems and other items from the automation interface?  I wrote a .NET plugin "server" a while ago that supports what I need from the automation interface but I would prefer to use your built-in Web Service which has the potential to be faster among other benefits.  I would be glad to list all the functions that I added to my "server" if you are interested.  Thanks.
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42442
  • Shoes gone again!
Re: Kudos - And Web Service Question
« Reply #13 on: August 13, 2009, 05:17:24 pm »

I would be glad to list all the functions that I added to my "server" if you are interested.  Thanks.

Yes, please.

This is a background priority project, but we hope to continue improving the web service interface.

Feature requests are very welcome.
Logged
Matt Ashland, JRiver Media Center

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3123
Re: Kudos - And Web Service Question
« Reply #14 on: August 13, 2009, 08:39:17 pm »

Here is a list of functions that I need:

1) GetViewItem
input: ViewItem name/path
returns: name/path, random thumbnail (thumbnail file name) for one of the files, number of child ViewItems, number of files, files duration

2) GetChildViewItems
input: ViewItem name/path
returns: list of child ViewItems with data as above

3) GetViewItemFiles
input: ViewItem name/path, sort string (as in Sort2()) or "shuffle"
returns: list of files sorted appropriately

4) GetFileThumbnail
input: file name or id, thumbnail size
returns: thumbnail file name with path

5) FillFileTemplate
input: file name or id, template string
returns: filled template string

6) GetFileTag
input: file name or id, field name
returns: tag value
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

kanebullen

  • Recent member
  • *
  • Posts: 8
Re: Kudos - And Web Service Question
« Reply #15 on: August 17, 2009, 01:08:47 am »

Yes, please

This is a background priority project, but we hope to continue improving the web service interface.

Feature requests are very welcome.

Perhaps I'm looking at the documentation wrong, but I can't seem to retrieve anything useful about the now playing list, apart from a string of numbers, which I assume corresponds to a database ID for each song in the list?    Is there any way we can retrieve info for each song?    I currently just want the name and artist of the currently playing song..

Cheers

Kane
Logged

scriptx

  • Member
  • *
  • Posts: 3
Re: Kudos - And Web Service Question
« Reply #16 on: August 26, 2009, 11:10:42 pm »

I'll second cncb's request as well for the interface!
Logged

kanebullen

  • Recent member
  • *
  • Posts: 8
Re: Kudos - And Web Service Question
« Reply #17 on: December 14, 2009, 09:06:11 am »

Perhaps I'm looking at the documentation wrong, but I can't seem to retrieve anything useful about the now playing list, apart from a string of numbers, which I assume corresponds to a database ID for each song in the list?    Is there any way we can retrieve info for each song?    I currently just want the name and artist of the currently playing song..

Cheers

Kane

Just a polite bump - can you advise when you expect any extra functionality to be added to the web service?       It doesn't seem as though you can do something as simple as retrieving the name of the currently playing song in a particular zone.   

From what I can see, I can get the "FileKey", but this is essentially just the unique ID for that file..  There doesn't seem to be a GetFileByFileKey method to retrieve info about that file??

Or am I looking at things incorrectly?

Thanks,

Kane
Logged

NsiK_Fh8

  • Recent member
  • *
  • Posts: 7
Re: Kudos - And Web Service Question
« Reply #18 on: March 12, 2010, 07:53:12 pm »

Hi, just wondering. Are there a way to get the current playlists and playlist tree from Media Center? I know I can get them via Remote Server but that doesn't bring up the playlists tree just all my current playlists in one row.

Thanks.
Logged
Pages: [1]   Go Up