Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I am working on a project using webservices. I got a problem in calling webservices to Business Object which is in other project.
I wrote webservices in one project using asp.net webservices and the main coding part in other project using asp.net website.
1. These are the two methods that I wrote in webservices.
C#
[WebMethod]
    public List<RestaurantCategory> GetAllCategories()
    {
        return dc.RestaurantCategories.ToList();
    }
    [WebMethod]
    public List<RestaurantCategory> GetCategoryByPKID(int pkcategoryId)
    {
        var query = dc.RestaurantCategories.Where(c => c.PkCategoryId == pkcategoryId).ToList();
        return query;
    }


2. I have to call the webservices to Business Object class using Linq and I wrote the code like
C#
 RRFDataContext dc = new RRFDataContext();
 WebService objProxy = new WebService();
 RestaurantCategory objcategoryws = new RestaurantCategory();
 public List<RestaurantCategory> GetAllCategories()
 {
     return dc.RestaurantCategories.ToList();
 }
 public localhost.RestaurantCategory GetCategoryByPKID(int pkcategoryId)
{
    return ((objProxy.GetCategoryByPKID(pkcategoryId));
}


The problem is when I select select button in gridview the formview is not being displayed because to select I selected GetCategoryByPKID.
Please check the above code and give me reply soon.

Thanks
Posted
Updated 14-Oct-10 21:49pm
v2

1 solution

what do you get in return? and is your code hitting the web service? make the service host on localhost and put a breakpoint in - to make sure your hitting it with your button.
 
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