Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This won't get you an <code>XmlTextWriter</code>, but to be honest I've always used <code>XmlWriter</code> when writing to a file anyway (<code>XmlWriter</code> is the base class of <code>XmlTextWriter</code>.)</p> <p>You can use <code>XmlWriter.Create(Server.MapPath("output.xml"), settings)</code> which will give you an <code>XmlWriter</code> instead of an <code>XmlTextWriter</code>. Your encoding will then need to be set in your settings instance (<code>settings.Encoding = enc</code>.)</p> <p>EDIT:</p> <p>The sample code provided for me produces:</p> <pre><code>&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;soap:Body xmlns:ns1="http://its/foo.wsdl" /&gt; &lt;/soap:Envelope&gt; </code></pre> <p>EDIT 2:</p> <p>Your namespace is causing a problem because it's trying to put the element name as <code>ns1:securityid</code> when it should be the element name is <code>securityid</code> and the namespace <code>ns1</code>. You'll need to separate these like you've done in the <code>WriteAttributeString</code> call, like so:</p> <p>instead of: <code>xml.WriteStartElement("ns1:biographicalcaptureElement")</code> use: <code>xml.WriteStartElement("biographicalcaptureElement", "ns1")</code></p> <p>With these changes in place I now get:</p> <pre><code>&lt;!----&gt; &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;soap:Body xmlns:ns1="http://its/foo.wsdl"&gt; &lt;biographicalcaptureElement xmlns="ns1"&gt; &lt;securityid&gt;TEST123&lt;/securityid&gt; &lt;requestdata /&gt; &lt;/biographicalcaptureElement&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload