[WebService] General Media Access Webservice (1 Viewer)

offbyone

Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    When installing I get an error that the service can't be started. Error in EventLog:

    Code:
    Der Dienst kann nicht gestartet werden. System.InvalidOperationException: Fehler beim Laden von Attribut "OperationBehaviorAttribute" für Methode "MP_GetFullSeries" in Typ "IMediaAccessService". Weitere Details finden Sie unter "InnerException". ---> System.IO.FileNotFoundException: Die Datei oder Assembly "System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
       bei System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
       bei System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
       bei System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
       bei System.Reflection.CustomAttribute.F...

    What do I need to have installed? (.Net Framework 4.0 Client Profile is installed - came on Windows Update)
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    40
    Austria
    Home Country
    Austria Austria
    When installing I get an error that the service can't be started. Error in EventLog:

    Code:
    Der Dienst kann nicht gestartet werden. System.InvalidOperationException: Fehler beim Laden von Attribut "OperationBehaviorAttribute" für Methode "MP_GetFullSeries" in Typ "IMediaAccessService". Weitere Details finden Sie unter "InnerException". ---> System.IO.FileNotFoundException: Die Datei oder Assembly "System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
       bei System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
       bei System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
       bei System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
       bei System.Reflection.CustomAttribute.F...

    What do I need to have installed? (.Net Framework 4.0 Client Profile is installed - came on Windows Update)

    Yeah, Client Profile isn't enough iirc, you need the full .net 4.0 -> Download details: Microsoft .NET Framework 4 (Standalone Installer)
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    Thx that was it. The installer could have a launch condition for that!
    Next question as there are neither docs on codeplex or in the thread ;) :
    What port do I have to free in my firewall?
     

    Mike Lowrey

    Portal Pro
    February 4, 2009
    638
    124
    Berlin
    Home Country
    Germany Germany
    Normally the installer should add a firewall exception. To do this by yourself you have to free port 44321. If this port doesn't fit to your needs you can change it in the services config in the program folder.

    And no currently there is no documentation, just ask what you need to know.
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    Thx the firewall exception is in place, working fine!
    What's an sample URL I can call in the browser to test some functions?
     

    Mike Lowrey

    Portal Pro
    February 4, 2009
    638
    124
    Berlin
    Home Country
    Germany Germany
    If you want to check the basic functionality you can use http://localhost:44321/GmaWebService/MediaAccessService

    For a more "interesting anwser" you can use this http://localhost:44321/GmaWebService/MediaAccessService/json/MP_GetSupportedFunctions

    My answer for example is this:
    Code:
    {"MoviesFunction":{"Description":"MovingPicture Movies","Id":0,"ImagePath":"\/Thumbs\/Movies.png","Name":"Movies"},"MusicFunction":{"Description":"Listen to your music","Id":0,"ImagePath":"\/Thumbs\/Music.png","Name":"Music"},"PicturesFunction":{"Description":"Watch your pictures","Id":0,"ImagePath":"\/Thumbs\/Pictures.png","Name":"Pictures"},"SupportsMovies":true,"SupportsMusic":true,"SupportsPictures":true,"SupportsTV":false,"SupportsTvSeries":true,"SupportsVideos":true,"TVFunction":null,"TvSeriesFunction":{"Description":"MP-TvSeries TV Shows","Id":0,"ImagePath":"\/Thumbs\/TVSeries.png","Name":"TV Series"},"VideosFunction":{"Description":"MediaPortal Videos","Id":0,"ImagePath":"\/Thumbs\/Videos.png","Name":"Videos"}}

    When you use the last url your browser will prompt for a username and a password which is saved in the config.xml default values are admin/admin
     

    Oxan

    Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    I've some feedback the development version of WebMediaPortal. You probably already know this, but anyway:
    - SQL Server is required. I guess that most users of MediaPortal use MySQL, and that forcing another database server for just an authentication mechanism is a bit too much.
    - The home link links to the document root (/), not to the root of the application (I run it under /WebMediaPortal)
    - You need to be logged in to register... That's hard to create the first user.
    - The white text of the 'log off' link is quite hard to read on the light-yellow background.
    - Util.GetLogin() expects username and password to be childnodes of <config> instead of attributes (in config.xml)

    But except these issues it looks really good. Thanks for your work!
     

    Mike Lowrey

    Portal Pro
    February 4, 2009
    638
    124
    Berlin
    Home Country
    Germany Germany
    Hi,

    thank you for your feedback :)

    Just for clarification: The WebMediaPortal isn't ready yet that's the reason why things like authentication and registration aren't working on everyones machine.
    The release is mainly for the webservice because for example aMPdroid needs a release ;)

    If you are interested in contributing to WebMediaPortal (especially with regard to issues with authentication and registration since i'm not familiar with all the options to implement this) feel free tell me how you would do it :)
     

    Oxan

    Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    I'm not too familiar with ASP.NET at all, so you shouldn't take my answer for the truth, but I have an idea. You can create a subclass of the MembershipProvider class that reads and writes the users into the XML config. Then you can create a default user and the first-registration problem is solved too. But if you're planning to use the database for more features than this isn't very scalable and using the DB is probably a better option.

    I'm interested in contributing to WebMediaPortal (especially the television part), but as I said above I'm not that familiar with ASP.NET MVC so I'm trying to get how it works first. As for the code; I agree that a cleanup of GmaWebService, as you said here would be nice, but the WebMediaPortal code itself looks good. Also, I miss the point of prefixing all methods with MP_. Was that done with a reason?
     

    Users who are viewing this thread

    Top Bottom