How to use the WepAPI

Posted By Boxson Fri 25 Oct 2013
Add to Favorites0
Author Message
Boxson
 Posted Fri 25 Oct 2013
Supreme Being

Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)

Group: Forum Members
Last Active: Thu 12 Dec 2013
Posts: 14, Visits: 70
Hi all,

i'm trying to use the WebAPI. I wrote a small C# Application which connects to the WebAPI to read categories and write new categories to kartris.

I'm stuck with the Execute Method. I always recieve an error from Web API telling me that the method called could not be found in class. If i open the Class File i see there are the methods and they are called with the right name.


string WSresult = WSClient.Execute("LoginsBLL.GetDetails", "<Parameter Name=\"UserName\" Type=\"String\" Value=\"[email protected]\"/>");
MessageBox.Show(WSresult);


returns


<?xml version="1.0" encoding="utf-16"?>
<string>Error parsing method string! Exception Details -&gt; Can't find method "Getdetails" in Class "LoginsBLL"</string>


Any Idea whats wrong? Authetication is working right, if i change the token i get a message telling me authentication is wrong.
Medz
 Posted Fri 25 Oct 2013
Kartris Expert

Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)

Group: Administrators
Last Active: Tue 3 Dec 2013
Posts: 99, Visits: 1,400
The strMethodName parameter is case sensitive. Make sure you're passing method "LoginsBLL.GetDetails" and not "LoginsBLL.Getdetails. Also the UserName parameter there should be the backend login username. It seems like you're passing the email address instead.
Boxson
 Posted Fri 25 Oct 2013
Supreme Being

Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)

Group: Forum Members
Last Active: Thu 12 Dec 2013
Posts: 14, Visits: 70
string WSresult = WSClient.Execute("LoginsBLL.GetDetails", "<Parameter Name=\"UserName\" Type=\"String\" Value=\"Admin\"/>");


is showing the same result. The Error is telling that the Method "GetDetails" could not be found in Class LoginsBLL.

Any other hint?
Medz Marked As Answer
 Posted Fri 25 Oct 2013
Kartris Expert

Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)

Group: Administrators
Last Active: Tue 3 Dec 2013
Posts: 99, Visits: 1,400
Can you let me know which Kartris version are you using? Also the parameter string looks incorrect. It should be ->

 "<Parameter Name=\"UserName\" Type=\"String\"><Value>Admin</Value></Parameter>"
Boxson Marked As Answer
 Posted Mon 28 Oct 2013
Supreme Being

Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)Supreme Being - (10,714 reputation)

Group: Forum Members
Last Active: Thu 12 Dec 2013
Posts: 14, Visits: 70
I'm using latest version (2.5005). I've changed the "Value"-Part in XML and now it's working.
Thanks for your help!!
Medz
 Posted Mon 28 Oct 2013
Kartris Expert

Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)Kartris Expert - (65,902 reputation)

Group: Administrators
Last Active: Tue 3 Dec 2013
Posts: 99, Visits: 1,400
That great! Can you please mark my previous post as 'solution' so it's easier for other users to find it in future? Thanks.

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top