Results 1 to 3 of 3

Thread: [RESOLVED] WCF Service Contracts

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2008
    Posts
    103

    Resolved [RESOLVED] WCF Service Contracts

    Hi,

    I've been reading up on WCF online / books etc.

    If possible, please could you let me know if the following is correct.

    1. A Service Contract is created in the form of an interface by decorating it with the ServiceContract / OperationContract attributes etc.

    2. The implementation for this interface is then provided in a class.

    3. The endpoint is configured in the following format:

    <endpoint address="http://localhost:8080/somename/somenameservice"
    binding="basicHttpBinding" contract="somename.somename.InterfaceName"

    My question is: In the 'Contract' section of the endpoint, is this specifying that only methods/members of a class that implements the InterFace created earlier can be invoked by a client application attempting to consume the service?

    For example if my interface (IMyInterface) includes a method called GetName()
    I then implement this in a class.
    I then provide the following endpoint contract:
    contract="somename.somename.IMyInterface"

    Does this mean that my client app can use only the method specified in the Interface name specified in the contract above (IMyInterface)?

    Thanks

    Hope this makes sense.

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: WCF Service Contracts

    Yep that is correct, your client can only call the methods in the interface that are decorated with the OperationContract attribute
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2008
    Posts
    103

    Re: WCF Service Contracts

    Thanks for your help.

Posting Permissions

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



Click Here to Expand Forum to Full Width