SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Web Service

  1. #1
    SitePoint Wizard boxhead's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,040
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Web Service

    I have a c# web applications that contains two programmes. One of the programmes has a part which accepts a dictionary of contacts (name, email address) which either programme can use.

    I now want to split the programmes into separate application on the same web server (different app pools), so I now need app 2 to send a dictionary to app 1. I think the best way to achieve this is via a web service on app 1. I have started the web service (asmx/cs) and think I can get that side of it working, but I can't work out how to get app 2 to reference the web service from app 1.

    How do I do this - I can't find anything in the references that looks right! Do I need to compile a dll or anything like that? Any help or pointers in general greatly appreciated
    monkey - the rest is history

  2. #2
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,869
    Mentioned
    38 Post(s)
    Tagged
    0 Thread(s)
    All you should need to do, is to add a service reference to your other project. Visual Studio should handle the rest. You could also look at creating a WCF service instead of older SOAP service

  3. #3
    SitePoint Wizard boxhead's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,040
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by NightStalker-DNS View Post
    All you should need to do, is to add a service reference to your other project. Visual Studio should handle the rest. You could also look at creating a WCF service instead of older SOAP service
    OK, so I've gone back and changed to a WCF and have added a reference in VS, but if it try this:

    NominalCommunicationServiceClient client = new NominalCommunicationServiceClient();

    it doesn't work - the service is not recongnised (no intellience or colour coding)! Am I missing something? The page for the service has something about running this:

    svcutil.exe http://localhost/npt/contacts/Nomina...rvice.svc?wsdl

    do i need to do that, or is that covered when i create the reference?
    monkey - the rest is history

  4. #4
    Community Advisor ULTiMATE's Avatar
    Join Date
    Aug 2003
    Location
    Bristol, United Kingdom
    Posts
    2,158
    Mentioned
    46 Post(s)
    Tagged
    0 Thread(s)
    Could you not serialise the object to the file system? Get App 1 to write to the file system with your serialised object, and then get App 2 to read from that location.

  5. #5
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,869
    Mentioned
    38 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by boxhead View Post
    he page for the service has something about running this:

    svcutil.exe http://localhost/npt/contacts/Nomina...rvice.svc?wsdl

    do i need to do that, or is that covered when i create the reference?
    That should be done automatically when you add a reference as it generates the classes you need. For the contracts, etc. This is a very strange issue. Can you resolve the WSDL in your browser and is it well formed?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •