Home Why doesn't my WebAPI endpoint not return the expected output
Reply: 0

Why doesn't my WebAPI endpoint not return the expected output

aria
1#
aria Published in 2017-09-14 07:44:24Z

I have an API with one Get action which looks like the following:

public string GetSearchEshtrak(string A_SHENASEHG)
{
    var sample1 = new ObjectParameter("oUTSHENASEHP", typeof(string));
    var sample2 = new ObjectParameter("oUTAMT", typeof(int));
    var model2 = db.USSD_100(A_SHENASEHG, sample1, sample2).ToString();
    return (model2);
}

Everything appears to run correctly and I see my my USSD_100 method is also returning the expected results.

However, when calling the endpoint with my browser Firefox the result is as follows:

<string>-1</string>

This XML is not what I expected it to be and doesn't has any information from the model2 object.

What do I have to do to return the model2 correctly, so I can see the model object as XML in the browser.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.304662 second(s) , Gzip On .

© 2016 Powered by cudou.com design MATCHINFO