Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I ended up removing the web service reference from my project and instead wrote a utility class for sending a SOAP request and getting the response back in XML, thanks to <a href="http://www.eggheadcafe.com/articles/20011103.asp" rel="nofollow noreferrer">this tutorial</a>. Here are a couple snippets:</p> <pre><code>public XmlDocument SendSoapRequest(XmlDocument soapRequest) { var webRequest = getWebRequest(); Stream requestStream = webRequest.GetRequestStream(); soapRequest.Save(requestStream); requestStream.Close(); WebResponse webResponse = webRequest.GetResponse(); requestStream = webResponse.GetResponseStream(); var soapResponse = new XmlDocument(); soapResponse.Load(new XmlTextReader(new StringReader( new StreamReader(requestStream).ReadToEnd() ))); return soapResponse; } private HttpWebRequest getWebRequest() { var webRequest = (HttpWebRequest)WebRequest.Create(Url); webRequest.Credentials = CredentialCache.DefaultCredentials; webRequest.Headers.Add("SOAPAction", SoapAction); webRequest.ContentType = ContentType; webRequest.Accept = AcceptHeader; webRequest.Method = RequestMethod; return webRequest; } </code></pre> <p>I then use an XPath query to navigate the returned <code>XmlDocument</code> and get the data I want, the data that was <em>not</em> showing up in the <code>DataSet[]</code> that I got back from the web service when I used a web reference. I already had a class that implements <code>IXmlSerializable</code> so once I navigate the returned XML with XPath, I just pass an <code>XmlReader</code> to my class's <code>ReadXml</code> method and the class instance gets populated.</p>
 

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