title: Call a method from SOAP Web Service
body: <p>I'm working on a protocol which is designed to be implemented with SOAP over HTTP. 
  WSDL files are provided by a third party. </p>
  
  <p>I used wsdl.exe to generated a proxy class and created a Web Service Project in VS.</p>
  
  <pre><code>wsdl.exe yourFile.wsdl /l:CS
  </code></pre>
  
  <p>I got a cs from a unwrapping wsdl.</p>
  
  <p>Snippet:</p>
  
  <pre><code>[System.Web.Services.Protocols.SoapHeaderAttribute("chargeBoxIdentity")]
  [System.Web.Services.WebMethodAttribute()]
  [System.Web.Services.Protocols.SoapDocumentMethodAttribute("/ClearCache", RequestElementName="clearCacheRequest", RequestNamespace="urn://Ocpp/Cp/2012/02/", ResponseElementName="clearCacheResponse", ResponseNamespace="urn://Ocpp/Cp/2012/02/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
  [return: System.Xml.Serialization.XmlElementAttribute("status")]
  public abstract ClearCacheStatus ClearCache();
  </code></pre>
  
  <ul>
  <li>Implementation 1 (Server Side)</li>
  </ul>
  
  <p>A central system (Server) connected to devices. When a device initialized, it sends an authorisation to central system.
  And Server response an authorisation message back.
  I have already done with Server Side which provides all clients send requests to Server. And Server response the messages.It works well.</p>
  
  <ul>
  <li>Implementation 2 (Central system send a message to a device)
  <img src="https://i.stack.imgur.com/lLtfu.jpg" alt="enter image description here"></li>
  </ul>
  
  <p>The other part of implementation is a central system need to send message to device (ex. clear devices cache, please see a snippet above). I add those methods to web service as well.</p>
  
  <p><strong>My questions</strong> are...</p>
  
  <ol>
  <li><p>How can I send a message to devices through a proxy from Web Service?</p></li>
  <li><p>It's impossible to call a method from Web Service sending requests to device? Any suggestions?</p></li>
  <li><p>Or I need to create a project implementing a ClearCache method and format as a SOAP message to trigger?</p></li>
  </ol>
  
  <p>Thanks!</p>