I am tasked with creating a WCF service operation that is going to transform XML from one form to another using XSLT. When doing this with plain old asmx Web Services I used an input parameter of type XmlDocument and a return type of the same.
The input XmlDocument needs to have an associated schema and namespace. In fact when our tester, tests this using SOAP UI against the asmx Web Service they get the following error -
Error: Type 'TXLife_Type' in namespace 'http://ACORD.org/Standards/Life/2' cannot be imported. Attributes must be optional and from namespace 'http://schemas.microsoft.com/2003/10/Serialization/'. Either change the schema so that the types can map to data contract types or use ImportXmlType or use a different serializer.
I am thinking that what I really need is 3 namespaces one for the ServiceContract one for the input XML parameter and one for the output XML being returned. How do I do this?
code// this is from the IService1.cs [ServiceContract(Namespace="itsawonderfullife.com/LifeSOA/Services/"), XmlSerializerFormat] public interface IService1 { [OperationContract, XmlSerializerFormat] Output TX103toLifeCommTest(InputTx103 tx103); } [MessageContract(WrapperNamespace = "ACORD.org/Standards/Life/2"), XmlSerializerFormat] public class InputTx103 { public XmlDocument TXLife; } [MessageContract, XmlSerializerFormat] public class Output { public XmlDocument TXLife; }code- John Aschenbrennercode// this is from the client generated code [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] Output IService1.TX103toLifeCommTest(InputTx103 request) { return base.Channel.TX103toLifeCommTest(request); } public void TX103toLifeCommTest() { InputTx103 inValue = new InputTx103(); Output retVal = ((IService1)(this)).TX103toLifeCommTest(inValue); }code- John Aschenbrenner