The following code samples are from my aspx web service.
I would like to know how it should be changed so that i could return it as an object. All the following codes are on the web service and i am trying to call the object from Android.
So i would just like to know what changes i have to make in order to be able to pass the object.
Any help would be greatly appreciated.
[WebMethod]
public object SomeMethod(Vehicle obj)
{
return obj;
}
[WebMethod]
public void simpleCase()
{
Vehicle obj = new Vehicle();
obj.VehicleID = "KL-9876";
obj.VehicleType = "Nissan";
obj.VehicleOwner = "Sanjiva";
}
public class Vehicle
{
public string VehicleID { get; set; }
public string VehicleType { get; set; }
public string VehicleOwner { get; set; }
}
Don’t forget about this in global.asax:
RouteTable.Routes.Add(new ServiceRoute(“salesman”, new WebServiceHostFactory(), typeof(SalesmanService)));
Basically you should be able to make such a call:
“..localhost/salesman/50” for example
This is just a small sample, you’ll have to put your hands on wcf and json for a wider understanding.