Exemplo n.º 1
0
        public static string ToSoapXml <T>(this T value)
        {
            var xml = value.ToXml();

            xml = xml.Replace("<?xml version=\"1.0\" encoding=\"utf-16\"?>", string.Empty)
                  .Replace("<?xml version=\"1.0\" encoding=\"UTF-16\"?>", string.Empty)
                  .Replace("<?xml version=\"1.0\" encoding=\"utf-8\"?>", string.Empty)
                  .Replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", string.Empty)
                  .Replace("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"", string.Empty)
                  .Replace("xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"", string.Empty)
                  .Replace("\\", string.Empty);

            var soap = SoapUtilities.GenerateSoap(xml);

            return(soap);
        }
Exemplo n.º 2
0
        public static T FromSoapXml <T>(this string soapXml)
        {
            var soapBodyXml = SoapUtilities.StripSoapThings(soapXml);

            return(FromXml <T>(soapBodyXml));
        }