web service data type RRS feed

  • Question

  • User-583959464 posted

    <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" >
            <RequestData xmlns="http://tempuri.org/">

    in DetailsObject field, there is <Countries>, which may contain 1 or multiple <Country> element inside <Countries> field.

    how can i know the data of <DetailsObject> and data type of <Countries> in <DetailsObject> in document.

    Monday, February 22, 2021 8:21 AM

All replies

  • User1535942433 posted

    Hi 20141113,

    According to your description, I suggest you could refer to the following code to parse SOAP format xml file.

    string xml = Server.MapPath("SOAPFile.xml");
                XmlDocument xmldoc = new XmlDocument();
                XmlNamespaceManager xnm = new XmlNamespaceManager(xmldoc.NameTable);
                xnm.AddNamespace("SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/");
                xnm.AddNamespace("Mo", "http://www.monternet.com/dsmp/schemas/");
                XmlNodeList lst = xmldoc.SelectNodes("//SOAP-ENV:Header/Mo:TransactionID", xnm);
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < lst.Count; i++)
                    XmlNode node = lst[i];
                    XmlElement ele = (XmlElement)node;
                    sb.AppendLine(ele.Name + ":" + ele.InnerText);
                    sb.AppendLine("<br />");

    More details,you could refer to below article:


    Best regards,

    Yijing Sun

    Tuesday, February 23, 2021 3:54 AM