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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. WCF and WF
  4. Accessing WCF service

Accessing WCF service

Scheduled Pinned Locked Moved WCF and WF
questioncsharpwcfwindows-admin
3 Posts 3 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.
  • S Offline
    S Offline
    sarang_k
    wrote on last edited by
    #1

    HI all, I am new to WCF services.I have created a WCF service and hosted it in IIS 7 in windows 2008 on one system. Now again i have created a windows application in another system and i want to add that WCF service in it. How can i do it,while adding the service i am not able to do. Should i make any changes in web.config file of WCF service or in App.config in windows application ? Thanks in advance.

    L A 2 Replies Last reply
    0
    • S sarang_k

      HI all, I am new to WCF services.I have created a WCF service and hosted it in IIS 7 in windows 2008 on one system. Now again i have created a windows application in another system and i want to add that WCF service in it. How can i do it,while adding the service i am not able to do. Should i make any changes in web.config file of WCF service or in App.config in windows application ? Thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Add a Service reference to the project of the windows application you want to use the service in. This is done by right clicking the project and select "Add Service" A dialog will then open. You need to then enter the URL for the service. If it is found the services table will populate and you can click on it to see what operations will be allowed. It will auto fill a default namespace for you (ServiceReference1), so change it if you want a different NS. Once you click "OK" it will add quite a few files that give you access to the service in Client form. Create the object and then you can call the methods upon it.

      Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

      1 Reply Last reply
      0
      • S sarang_k

        HI all, I am new to WCF services.I have created a WCF service and hosted it in IIS 7 in windows 2008 on one system. Now again i have created a windows application in another system and i want to add that WCF service in it. How can i do it,while adding the service i am not able to do. Should i make any changes in web.config file of WCF service or in App.config in windows application ? Thanks in advance.

        A Offline
        A Offline
        Amit Sk Sharma
        wrote on last edited by
        #3

        adding a service reference is better way. alternatively you can use "svcutil" to create a proxy of your service. for that u need to open your command prompt. open the folder where your svcutil.exe exists physically. (alternatively u can copy it in one newly created folder) then execute following command. svcutil.exe "url of your WCF service" as parameter. it will give you two files one cs and one config file. include the ".cs" file in your Windows application and merge .config file's contents to your application's app.config. it's a manual process in comparison to Add Service Reference. but it works fine.

        With Thanks & Regards Amit Sk Sharma

        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