Error while adding XSDElementFault in operation

Nov 9, 2009 at 11:49 PM


I created a simple service with 1 operation having input and output messages. It complied without error and generated code

I then added "Add new XSD element Fault" and pointed the element to a XSD Message. When I try to compile it, got the following error.

The Operation 'Operation1' contains the XsdElementFault 'XsdElementFault1' which is only supported for DataContractSerializer. 

Can anyone Please help to resolve the issue? I have already set the service contract model 's serializer property to "XMLSerializer".

Thanks for your time and help


Nov 10, 2009 at 12:24 AM

You should set the SC serializer to DataContractSerializer in order to use the XsdElementFault in this case.

Nov 10, 2009 at 1:03 AM

Thanks for the help.

But I m using XSD input and out put messages. So the serializer has been set to XML serializer.

If I comment out the Fault message from wsdl while using "import from wsdl", it imports correctly.

Does import from wsdl support import of fault messages? If so can u please provide a sample wsdl with fault message

Thanks for your time and help

May 9, 2010 at 11:17 AM

i'm facing same issue 

was anyone able to import use Import WSDL with operation that has fault messages ?! 

May 10, 2010 at 5:23 PM
We were able to import the wsdl but have to comment out the fault message.
We could not find a way to import fault messages becaz there was no option to have fault messages in the form of xml thru import wsdl

On Sun, May 9, 2010 at 3:18 AM, samifahmy <> wrote:

From: samifahmy

i'm facing same issue 

was anyone able to import use Import WSDL with operation that has fault messages ?! 

Read the full discussion online.

To add a post to this discussion, reply to this email (

To start a new discussion for this project, email

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at

May 28, 2010 at 11:08 AM

Hi smita,

The Import WSDL can work with Faults as long as you set DC serializer. The potential issue with this is that your WSDL may have faults but does not support DC serializer on your other schema types which may only support XML serializer. In order to get both scenarios you may change your schema types to support DC serializer or remove the faults as you already noticed.

You can also give it a try to the new Import WSDL 2010 and let me know if you can solve this issue or send me the WSDL to repro and try to investigate further.



Mar 8, 2011 at 6:47 PM

Hi All

I tried to import my wsdl that uses fault contracts s and XSDs on vs 2010
If I try to generate using XML serializer it fails saying that Fault contract are not support by XML serializer
If I try to generate using DataContract Serializer it fails because my XSDs does not follow the restriction required
So I need to ask two questions:
1-Did anyone solved these problems? and how?
2-Does the error related to fault contracts and XML serializer a design limitation for the .NET or design limitation for the Import WSDL or WSSF code
so it can be solved by digging into the code


Ahmed Shaaban