ServiceContract vs ServiceContractAttribute RRS feed

  • Question

  • Hello,

    It's maybe a simple question but I can't find the answer and it's bugging me ;)

    So I have generated my service interface using "svcutil xxx.wsdl xxx.xsd" (it has generated MessageContracts).

    On top of the interface and classes, it has generated things like this:

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "")]
    [System.ServiceModel.ServiceContractAttribute(Namespace="http://xxx", ConfigurationName="IxxxxReceiptPortType")]
    public interface IxxxxxReceiptPortType
        { ...}
    [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.1")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="")]
    public partial class Xxxx

    And FYI I have my implementation like that

    public class Ack : IxxxxxxReceiptPortType
            xxxxxxReceiptResponse IxxxxxxxxxReceiptPortType.SalesOrderAcknowledgmentReceipt(xxxxxxxxxxxxxxReceiptRequest request)

    It's not working yet, and I'm doing some research, but in forums, blogs etc, I often find [ServiceContract(...)] instead of my [System.ServiceModel.ServiceContractAttribute(...)], and with the same parameters.

    Is there any difference between the two? One better to use instead of the other?


    Thursday, August 15, 2013 11:08 PM