INTERACT FORUM

Please login or register.

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

Author Topic: Win8 Metro  (Read 1831 times)

gypr

  • Recent member
  • *
  • Posts: 9
Win8 Metro
« on: July 20, 2013, 10:15:56 pm »

Hi

Can anyone show me how to connect to the library server using the HttpClient used by a Metro app.


This works:
String rawXml = await GetData(@"http://webplay.jriver.com/libraryserver/lookup?id=xxxxxx");

Anything calling the server on the local network fails
String  rawXml = await GetData(@"http://10.0.0.4:52199/MCWS/v1/Alive");

public async Task<String> GetData(string url)
        {
            HttpClient http = new HttpClient();
           
            try
            {
                String SourceStream = await http.GetStringAsync(new Uri(url));

                return SourceStream;
            }
            catch(Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

            return null;
        }

Thanks
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42441
  • Shoes gone again!
Re: Win8 Metro
« Reply #1 on: July 21, 2013, 08:53:32 am »

Here are instructions for connecting:
http://wiki.jriver.com/index.php/Web_Service_Connection

For the call failures, maybe a firewall is blocking local network stuff?  Make sure it works in a web browser first.


Logged
Matt Ashland, JRiver Media Center
Pages: [1]   Go Up