Tech Off Post

Single Post Permalink

View Thread: ASP.NET 2.0 databinding to webservice
  • User profile image

    This is driving me crazy!

    I developed a very simple webservice, just one webmethod that returns a datatable.

    Then, in my ASP.NET 2.0 website, I added a web reference to this webservice, and used the ObjectDataSource to databind the results to a DataList. 
    So far so good, everything works like a charm on my dev machine.

    BUT when I put this website online, it doesn't work anymore!!!

    When using Eval("FileName") in the DataList I get the following error:

    System.Web.HttpException: DataBinding: 'Webmedia.GetImagesResponseGetImagesResult' does not contain a property with the name 'FileName'.

    Webmedia is just the name I gave to the web reference, and GetImages is the name of the Webmethod that I call in the Webservice.
    FileName is one of the fields in the DataTable that the webservice function returns.

    When using Container.DataItem("FileName") the error changes to:

    System.MissingMemberException: No default member found for type 'GetImagesResponseGetImagesResult'.

    Again, no matter which technique I use, it works perfectly when I run the website on my local Windows 2003 server.
    (it doesn't matter whether I run the webservice online or locally as well, it works both ways)
    Only when I run the website from the server on the Internet, I get the above server errors!
    I even tried on 2 different hosting servers to be sure it isn't related to the webserver itself...

    Anyone please have a clue what is happening here?