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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public ISoap11EnvelopeBuilder AddEntry(object toSerialise, string toElementName, string toElementNamespace)
 {
     return(this.AddEntry(ObjectXmlSerialiser.SerialiseObject(toSerialise, toElementName, toElementNamespace)));
 }
Ejemplo n.º 4
0
 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)));
 }