0

This is my project diagram:

  • MyWCFService
    • (...)
    • web.config
  • Friends.Implementation
    • Friends.svc
      • Friends.svc.cs
  • Friends.Contract
    • IFriends.cs

My endpoint of service:

  <service behaviorConfiguration="ServiceBehaviour" name="Friends.Implementation.Friends">
    <endpoint address="" behaviorConfiguration="web" binding="webHttpBinding" contract="Friends.Contract.IFriends" />
  </service>

My question is: How can I call this service? When I had that service in "Service" folder in MyWCFService project, it was easy - just localhost:XX/Services/Friends.svc.

And now, how can I run it, if everything is in separate class libraries?

Regards

whoah
  • 4,363
  • 10
  • 51
  • 81

1 Answers1

1

You can create a Services folder in your website root and paste the .svc file there, or you can use service activation:

<configuration>
  <system.serviceModel>
    <serviceHostingEnvironment>
      <serviceActivations>
        <add service="Friends.Implementation.Friends" 
             relativeAddress="Services/Friends.svc"/>
      </serviceActivations>
    </serviceHostingEnvironment>
  </system.serviceModel>
</configuration>
Community
  • 1
  • 1
CodeCaster
  • 147,647
  • 23
  • 218
  • 272
  • `relativeAddress` is requied for `add` - what should I type here? – whoah Dec 30 '13 at 13:52
  • @whoah see edit. See [A Developer's Introduction to Windows Communication Foundation 4](http://msdn.microsoft.com/en-us/library/ee354381.aspx) for some explanation on activation. – CodeCaster Dec 30 '13 at 13:53