0

I am attempting to pass this string through a C# code but fails:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">soap:Body1479374</soap:Body></soap:Envelope>

System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.LoadXml(string);

Tried to send as whole and as 3 parts but failing within Sectiona

string Sectiona = @"<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">soap:Body<acceptMessage xmlns = "http://ws.connectors.connect.mirth.com/" >< arg0 xmlns="">";

string Sectionb = "1479374";

string Sectionc = "</soap:Body></soap:Envelope>";

string DATA = Sectiona + Sectionb + Sectionc;

1 Answer 1

1

You soap body tag is wrong. Use xml linq :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string xml = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><soap:Body>1479374</soap:Body></soap:Envelope>";
            XDocument doc = XDocument.Parse(xml);
        }
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.