I am using svcutil.exe to generate a service endpoint based on a contract from an external source.
It seems to work as intended, but the service is not able to expose an endpoint to others.
Specifically, when I try to GET the WSDL for the service, an exception is thrown with the following error:
System.InvalidOperationException: An exception was thrown in a call to a WSDL export extension: System.ServiceModel.Description.XmlSerializerOperationBehavior contract: http://tempuri.org/xml/wsdl/soap11/DistributionService/1/port:DistributionReceiverWebServicePort ----> System.Xml.Schema.XmlSchemaException: The complexType 'http://tempuri.org/xml/wsdl/soap11/DistributionService/1/types:FejlType' has already been declared.
But - the type FejlType type is only declared once and is a very simple class:
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://tempuri.org/xml/wsdl/soap11/DistributionService/1/types")]
[System.Runtime.Serialization.DataContractAttribute(Name = "FejlType", Namespace = "http://tempuri.org/xml/wsdl/soap11/DistributionService/1/types")]
public class FejlType : object, System.Runtime.Serialization.IExtensibleDataObject
{
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
private string FejlKodeField;
private string FejlTekstField;
public System.Runtime.Serialization.ExtensionDataObject ExtensionData
{
get {return this.extensionDataField;}
set {this.extensionDataField = value;}
}
[System.Runtime.Serialization.DataMemberAttribute(IsRequired = true, EmitDefaultValue = false)]
public string FejlKode
{
get {return this.FejlKodeField;}
set {this.FejlKodeField = value;}
}
[System.Runtime.Serialization.DataMemberAttribute(IsRequired = true, EmitDefaultValue = false)]
public string FejlTekst
{
get {return this.FejlTekstField;}
set {this.FejlTekstField = value;}
}
}
I am totally in the dark here - why does WCF complain about this when exporting the WSDL?