SOAP
No edit summary
No edit summary
Line 7: Line 7:
SoapCalls take a action (above 'GetQuote') and set this as SOAPAction header
SoapCalls take a action (above 'GetQuote') and set this as SOAPAction header


<pre>
      StringBuilder soapenvelopebuilder = new StringBuilder();
      soapenvelopebuilder.Append(@"<?xml version = '1.0'  encoding='utf-8' ?>");
      soapenvelopebuilder.Append(@"<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"">");
      soapenvelopebuilder.Append(soapheaderbuilder);
      soapenvelopebuilder.Append("  <soap:Body " + @" xmlns:nsAction=""" + actionnamespace + @""">");
      soapenvelopebuilder.Append(@"    <nsAction:" + action + ">");
      soapenvelopebuilder.Append(parametersForSoapCall);
      soapenvelopebuilder.Append(@"  </nsAction:" + action + @">");
      soapenvelopebuilder.Append("  </soap:Body>");
      soapenvelopebuilder.Append("</soap:Envelope>");
</pre>
==== special variables ====
==== special variables ====
ViewModel variable named vSoapDebug – when we find this in the ViewModel – we assign the complete SoapEnvelope to this prior to sending it.
ViewModel variable named vSoapDebug – when we find this in the ViewModel – we assign the complete SoapEnvelope to this prior to sending it.

Revision as of 07:38, 18 October 2019

Call SOAP service like this:

vNewVar:=selfVM.SoapCall('http://www.webserviceX.NET/stockquote.asmx','GetQuote','http://www.webserviceX.NET/','','','NestingWParams')

SoapCall returns the body of the soap-envelope that is returned from the called service.

SoapCalls take a action (above 'GetQuote') and set this as SOAPAction header

      StringBuilder soapenvelopebuilder = new StringBuilder();
      soapenvelopebuilder.Append(@"<?xml version = '1.0'  encoding='utf-8' ?>");
      soapenvelopebuilder.Append(@"<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"">");
      soapenvelopebuilder.Append(soapheaderbuilder);
      soapenvelopebuilder.Append("  <soap:Body " + @" xmlns:nsAction=""" + actionnamespace + @""">");
      soapenvelopebuilder.Append(@"    <nsAction:" + action + ">");
      soapenvelopebuilder.Append(parametersForSoapCall);
      soapenvelopebuilder.Append(@"   </nsAction:" + action + @">");
      soapenvelopebuilder.Append("  </soap:Body>");
      soapenvelopebuilder.Append("</soap:Envelope>");

special variables

ViewModel variable named vSoapDebug – when we find this in the ViewModel – we assign the complete SoapEnvelope to this prior to sending it.

This page was edited 86 days ago on 02/10/2024. What links here