Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

Consuming a homemade rest service in asp.net webform

$
0
0
Hi

I've created my own rest service. For test purpose i've used Soap UI for testing of the service.

Now i try to consume this service in a webform. On the controller i can see that it has processed a call, so the service request gets through to my service. By debugging i can see that the rest server gets the data from the database.

When i try consuming the service in a asp.net 4.5 webform it hangs...

it just hangs on this statement
var response = await client.GetAsync("ServerConfig");


My request code looks like this:

private WebApiClientOptions options = new WebApiClientOptions("http://localhost:54990/api", "ServerConfig");
 
    protectedvoid Page_Load(object sender, EventArgs e)
    {
        List<ServerConfig> list = null;
 
        list = this.Index().Result;
      
    }
 
    publicasync Task<List<ServerConfig>> Index()
    {
        List<ServerConfig> list = null;
 
        using (WebApiClient<ServerConfig> client = new WebApiClient<ServerConfig>(options))
        {
            var liste = await client.GetManyAsync();
 
        }
 
        return list;
    }


i hope there is a clever person WHO can help a complete newbiee
Yours

Wilco

Viewing all articles
Browse latest Browse all 3938

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>