I\'m currently in the process of creating a WCF webservice which should be compatible with WS-I Basic Profile 1.1. I\'m using a wsdl-first approach (actually for the first time)
I think your problem is that you need to add elementFormDefault="qualified" as an attribute to the xsd:schema part of your wsdl. That worked for me.
I can give you an example of a fault that is being correctly generated for me through svcutil (with /useSerializerForFaults):
<xsd:schema targetNamespace="http://myproduct.mycompany.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:complexType name="MyError">
<xsd:sequence>
<!-- other stuff -->
<xsd:element name="description" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Is it possible that you are simply missing the namespace for your types?
This is the generated code:
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "3.0.4506.2152")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://myproduct.mycompany.com/")]
public partial class MyError
{
// other stuff
private string descriptionField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, Order = 1)]
public string description
{
get
{
return this.descriptionField;
}
set
{
this.descriptionField = value;
}
}
}
And this is my full svcutil cmd line statement (note that I am generating a service reference for a given existing service - but it shouldn't make much of a difference in terms of code generation):
svcutil /t:code /out:C:\MyRepository\GeneratedCode\MyServiceReference.cs /n:*,myproduct.mycompany.servicereference /UseSerializerForFaults C:\MyRepository\*.wsdl C:\MyRepository\*.xsd /config:C:\MyRepository\GeneratedCode\MyServiceReference.config