![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Defining WCF Fault Messages with a Message Contract I've got a WCF application, and i'm trying to get the WSDL just right. In my contract, I specify a Fault Contract: [OperationContract] [FaultContract(typeof(ValidationFault), Name = "ValidationFault")] Response DoSomething(Request input); This ValidationFault class is decorated with the standard data contract attributes. Everything works great, except the WSDL that's generated has names in it that I can't explicitly set. <wsdl:fault wsaw:Action="..." name="..." message="tns:BackgroundCheck_CheckOrderStatus_UnknownIdentifierFault_FaultMessage" /> I want to explicity set the message type, so that it's not left as that ungainly name. This WSDL is going to be with me for a long time to come, and if I can get it exactly right now, everything will be easier. I tried creating a MessageContract, and passing that type into the FaultContractAttribute, but that generates an ugly serialization exception. Any suggestions of how to explicitly create the FaultMessages? I'm using Beta2 of Orcas. (I'm trying hard not to manually write the WSDL file, or to even need to override the WSDL generation. I would like to do this with as little custom WCF code as I can...) -- Chris Mullins |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: Defining WCF Fault Messages with a Message Contract Chris, Best is to create a Behavior and create the FaultDescription yourself associating it to every operation available. That way you can control exactly what is generated (and not automatically concatenated) to the action and namespace of the fault. Tiago Halm "Chris Mullins [MVP - C#]" <cmullins@xxxxxx> wrote in message news:%23j5oZvGAIHA.4984@xxxxxx
| ||||||||||||
My System Specs![]() | |||||||||||||
| Thread Tools | |
| Display Modes | |
| |