Click here to Skip to main content
15,888,018 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Guys!

I am trying to create a metro application where the user can download applications that are available to them via the software catalog. After reading a few articles I came across this TechNet article that more or less gives me the code to do this:

http://blogs.technet.com/b/configmgrteam/archive/2012/09/19/extending-the-application-catalog-in-system-center-2012-configuration-manager.aspx[^]

Code:
C#
public MainWindow()
        {
            InitializeComponent();

            string url = "https://SERVERNAME/CMApplicationCatalog/ApplicationViewService.asmx";

            BasicHttpBinding binding = new BasicHttpBinding();
            binding.Security.Mode = BasicHttpSecurityMode.Transport;
            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;

            ApplicationCatalogService.ApplicationViewServiceSoapClient sc = new ApplicationViewServiceSoapClient(binding,new EndpointAddress(url));
            int total = 0;
            AppDetailView[] apps = sc.GetApplications(
                ApplicationProperty.Name,
                null,
                ApplicationProperty.Name,
                "",
                20,
                0,
                true,
                ApplicationClassicDisplayName.PackageProgramName,
                false,
                null,
                out total);

            foreach (var item in apps)
            {
                MessageBox.Show(item.Name);
            }
        }


This code will work for me using WPF or console applications but for some reason (im assuming performance reasons) only the ".GetApplicationsAsync" method is available. I have played around with this async method but am getting no reply - has anyone had any experience with this?

I assume only the async method is available due to the fluidity of metro apps?
I'm also getting an error that the web service isn't replying although I can navigate to that url and use it in WPF code...

Thank you.
Posted
Updated 18-Jun-13 23:55pm
v2

1 solution

Correct that methods like the one you're describing should all be async in order to keep the Win8 app moving.
Is it possible that you don't have the correct capabilities selected in your app's package manifest to give you internet access?
Also, be sure to use the "await" keyword so that you (eventually) get the return value(s) you're expecting.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900