Hi there I've defined a custom schema for a soap fault which looks like this: ... ...
I've genereated code in VS 2008:
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.3053")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.zurich.com/zsoa/corporate/common/2008/08/fault")]
[System.Xml.Serialization.XmlRootAttribute("zsoaFault", Namespace="http://schemas.zurich.com/zsoa/corporate/common/2008/08/fault", IsNullable=false)]
public partial class ZSOAFault : AbstractFault
{
...
I've developed a custom IErrorHandler (part of a framework shipped to all projects) which generates this custom soap fault like this:
Schemas.ZSOAFault.ZSOAFault zfault = new Schemas.ZSOAFault.ZSOAFault();
zfault.message = "hello";
zfault.operation = "operation";
zfault.serviceContext = "serviceContext";
zfault.serviceEndpoint = "serviceEndpoint";
zfault.timeStamp = DateTime.Now;
FaultException<Schemas.ZSOAFault.ZSOAFault> fe = new FaultException<Schemas.ZSOAFault.ZSOAFault>(zfault);
MessageFault msgFault = fe.CreateMessageFault();
It's important that the class Schemas.ZSOAFault.ZSOAFault has been generated from the schema and not from the application wsdl which imports the same schema also.
But when I look to this returned soap fault I see a different namespace:
<detail>
<ZSOAFault xmlns="http://schemas.datacontract.org/2004/07/Schemas.ZSOAFault" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<message>hello</message>
<exception i:nil="true"/>
<operation>operation</operation>
<serviceContext>serviceContext</serviceContext>
<serviceEndpoint>serviceEndpoint</serviceEndpoint>
<timeStamp>2010-07-14T14:31:58.5437649+02:00</timeStamp>
</ZSOAFault>
</detail>
I'd expected to see my namespace of the custom fault definition in the schema or am I wrong?
Thanks Oliver