public void WhenASOAPEnvelopeWithAHeaderBlockFromAnXContainerIsBuilt() { var obj = new XmlObjectWithRootAttribute { MyProperty = 2 }; this.soapEnvelope = SoapBuilder.CreateSoap12Envelope() .WithHeader.AddBlock(XElement.Parse(ObjectXmlSerialiser.SerialiseObject(obj, null, null))) .Build() .ToString(); this.xmlTester.ArrangeActualXml(this.soapEnvelope); const string expectedXml = @"<env:Envelope xmlns:env=""http://www.w3.org/2003/05/soap-envelope""> <env:Header> <XmlObjectWithRootAttribute xmlns=""http://root.attribute""> <MyProperty>2</MyProperty> </XmlObjectWithRootAttribute> </env:Header> </env:Envelope>"; this.xmlTester.ArrangeExpectedXml(expectedXml); }
public void WhenASOAPEnvelopeWithAHeaderBlockFromAnXMLStringIsBuilt() { var obj = new XmlObjectWithRootAttribute { MyProperty = 2 }; this.soapEnvelope = SoapBuilder.CreateSoap11Envelope() .WithHeader.AddBlock(ObjectXmlSerialiser.SerialiseObject(obj, null, null)) .Build() .ToString(); this.xmlTester.ArrangeActualXml(this.soapEnvelope); const string expectedXml = @"<env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/""> <env:Header> <XmlObjectWithRootAttribute xmlns=""http://root.attribute""> <MyProperty>2</MyProperty> </XmlObjectWithRootAttribute> </env:Header> </env:Envelope>"; this.xmlTester.ArrangeExpectedXml(expectedXml); }
public ISoap11EnvelopeBuilder AddEntry(object toSerialise, string toElementName, string toElementNamespace) { return(this.AddEntry(ObjectXmlSerialiser.SerialiseObject(toSerialise, toElementName, toElementNamespace))); }
public ISoap11EnvelopeBuilder AddEntry(object toSerialise) { return(this.AddEntry(ObjectXmlSerialiser.SerialiseObject(toSerialise, null, null))); }
public ISoap12EnvelopeBuilder AddBlock(object toSerialise) { return(this.AddBlock(ObjectXmlSerialiser.SerialiseObject(toSerialise, null, null))); }