SAF(NET) = STEPHEN A. FUQUA operating on the Web since 1995

Stephen is a web developer, Bahá'í, and interfaith activist in St. Paul, Minnesota. He likes to write about religion, social justice, sustainability, science, programming, &c.

April 2, 2010

How to assign namespace and action to FaultContract in ServiceContract Interface (Web Service Software Factory)?

I am using the latest edition of Service Factory - Modeling Edition (VS2008). I've created a number of FaultContracts in my DataContract model, and utilized them in my ServiceContract model. The generated code for the ServiceContract does not include the namespace or action for the FaultContract, i.e.

	[WCF::ServiceContract(Namespace = "http://mynamespace", Name = "MyServiceContract", SessionMode = WCF::SessionMode.Allowed, ProtectionLevel = ProtectionLevel.None )]
	public partial interface IMyServiceContract 
	{
		[WCF::FaultContract(typeof(MyFaultContract))]
		[WCF::OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "http://mynamespace/Contract/GetSomething", ProtectionLevel = ProtectionLevel.None)]
		PcaFocus.MessageContracts.GetSomethingResponse GetSomething(GetSomethingRequest request);

Whereas I expected the FaultContract attribute to be something like:

  [FaultContract(typeof(MyFaultContract), Namespace = "http://mynamespace", Action = "http://mynamespace/MyFaultContract", Name = "MyFaultContract")]
The effect is that the different Fault types are not recognized because of a de-serialization problem. That has the effect that I cannot catch specific faults with
catch (System.ServiceModel.FaultException<MyFaultContract> fault)
Does anyone know of a work-around for this?

Comments

Post a comment

Remember personal info?




deprecated

On safnet.com

Other sites managed or developed by S.A.F.

S.A.F. elsewhere on the web

  • LinkedIn
    LinkedIn can actually be useful when looking for prospective hires and business or organizational partners
  • GoodReads
    A fun and relatively-unknown social networking site geared towards one's book list
  • Live Journal
    Mirror of the blog at safnet.com, so that a few LJ friends can more easily read and comment there