Constructing a SOAP envelope using LINQ to XML

后端 未结 1 1184
离开以前
离开以前 2021-01-21 10:25

I have to construct an XML document which has a SOAP envelope like so:


  &         


        
1条回答
  •  盖世英雄少女心
    2021-01-21 11:08

    Try this

    XNamespace soap = "http://schemas.xmlsoap.org/soap/envelope/";
    
    XElement element = new XElement(soap + "Envelope", 
        new XAttribute(XNamespace.Xmlns + "SOAP-ENV", soap),
        new XElement(soap + "Body")); 
    

    0 讨论(0)
提交回复
热议问题