Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Reference errors using classes defined locally but then imported into a Webservice

Reference errors using classes defined locally but then imported into a Webservice

Scheduled Pinned Locked Moved Web Development
questiondatabasehostinghelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    redivider
    wrote on last edited by
    #1

    I have a forms project that will allow user to connect to a local database or a webservice hosting the data. So the flow goes something like: App builds request object (SearchCriteria) defined in a class library. Local data access layer and webservice both use the SearchCriteria object to run queries, and return a Results object (also defined in the class library). So my desktop app has a ClassLibrary project which defines the Request and Results classes. This dll is imported into the Webservice solution. I’ve developed an interface to define the contracts between the desktop app and the data provider (either the local DAL or the Webservice).

    public interface IDataAccess
    {
    DataTable GetCompanyMatches(SearchCriteria searchCriteria, out Results results);
    …
    }

    One edit to the Reference.cs file tells the compiler that my Webservice implements the interface. internal interface WSSoap : ITPDataAccess The problem is that when the Webservice returns the Results object the desktop app sees the type as Webservice.Results instead of ClassLibrary.Results, so the Webservice does not implement IDataAccess (even though I specify, in the webservice, webservice inherits from/implements IDataAccess.

    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class WebService : ITPDataAccess
    {…..}

    Is there a way to tell the WS to not put the ClassLibrary classes into the Webservice namespace? Is there some way on the app side to use the locally defined classes when interacting with the webservice? Basically how do i tell the compiler that they are the same thing, without rewriting the Reference.cs file??

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups