title: SOAP Client using C#
body: <p>I have Soap web service <a href="https://test-submit.health263.systems:8081/apacewebservices/AMF1_0?wsdl" rel="nofollow noreferrer">https://test-submit.health263.systems:8081/apacewebservices/AMF1_0?wsdl</a>. This has a method called <strong>process</strong>. My question is how do I create soap client to send a  request, that submits/Retrieves information from the server. The example XML for the request is shown below:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;Member xmlns=&quot;urn:apace:member:format:1.0&quot;&gt;
    &lt;Request&gt;
      &lt;Transaction&gt;
        &lt;VersionNumber&gt;1.0&lt;/VersionNumber&gt;
        &lt;Number&gt;434252-342234-6765&lt;/Number&gt;
        &lt;SystemIdentifier&gt;SYSTEM999&lt;/SystemIdentifier&gt;
        &lt;DestinationCode&gt;APACE&lt;/DestinationCode&gt;
        &lt;ClientCountryCode&gt;ZA&lt;/ClientCountryCode&gt;
        &lt;Timestamp TimeZone=&quot;Africa/Johannesburg&quot;&gt;20160601123456&lt;/Timestamp&gt;
        &lt;TestIndicator&gt;Y&lt;/TestIndicator&gt;
        &lt;User&gt;ProviderX/Jane Doe&lt;/User&gt;
      &lt;/Transaction&gt;
      &lt;MembershipLookup&gt;
        &lt;Funder&gt;AFunder&lt;/Funder&gt;
        &lt;WithMembershipNumber&gt;
          &lt;MembershipNumber&gt;123456789&lt;/MembershipNumber&gt;
        &lt;/WithMembershipNumber&gt;
      &lt;/MembershipLookup&gt;
    &lt;/Request&gt;
  &lt;/Member&gt;
  </code></pre>
  <p>The response message is structured as follows :</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;Member xmlns=&quot;urn:apace:member:format:1.0&quot;&gt;
    &lt;Response&gt;
      &lt;Transaction&gt;
        &lt;VersionNumber&gt;1.0&lt;/VersionNumber&gt;
        &lt;Number&gt;434252-342234-6765&lt;/Number&gt;
        &lt;Status&gt;S&lt;/Status&gt;
        &lt;Timestamp TimeZone=&quot;Africa/Johannesburg&quot;&gt;20160601123500&lt;/Timestamp&gt;
      &lt;/Transaction&gt;
      &lt;Membership NumberOfBeneficiaryRecords=&quot;2&quot;&gt;
        &lt;Funder&gt;AFunder&lt;/Funder&gt;
        &lt;MembershipNumber&gt;123456789&lt;/MembershipNumber&gt;
        &lt;Beneficiary SequenceNumber=&quot;1&quot;&gt;
          &lt;DependentCode&gt;00&lt;/DependentCode&gt;
          &lt;Type&gt;P&lt;/Type&gt;
          &lt;Status&gt;A&lt;/Status&gt;
          &lt;BiometricEnrolmentStatus&gt;Y&lt;/BiometricEnrolmentStatus&gt;
        &lt;/Beneficiary&gt;
        &lt;Beneficiary SequenceNumber=&quot;2&quot;&gt;
          &lt;DependentCode&gt;01&lt;/DependentCode&gt;
          &lt;Type&gt;D&lt;/Type&gt;
          &lt;Status&gt;A&lt;/Status&gt;
          &lt;BiometricEnrolmentStatus&gt;Y&lt;/BiometricEnrolmentStatus&gt;
        &lt;/Beneficiary&gt;
      &lt;/Membership&gt;
    &lt;/Response&gt;
  &lt;/Member&gt;
  </code></pre>
  <p>Please help I am really stuck, Haven't used SOAP services with C#, I have tried examples online but the structure does not follow my message structures are more complicated</p>
  <p>The actual message structure is structured as follows:</p>
  <pre><code>&lt;soap:Envelope
      xmlns:soap=&quot;http://www.w3.org/2003/05/soap-envelope&quot;
      xmlns:apac=&quot;http://apace.systems/apacewebservices/&quot;
      xmlns:urn=&quot;urn:apace:member:format:1.1&quot;&gt;
      &lt;soap:Header&gt;
          &lt;apac:secureToken&gt;Token66657752&lt;/apac:secureToken&gt;
      &lt;/soap:Header&gt;
      &lt;soap:Body&gt;
          &lt;apac:process&gt;
              &lt;apac:request&gt;
                  &lt;Member
                      xmlns=&quot;urn:apace:member:format:1.1&quot;&gt;
                      &lt;Request&gt;
                          &lt;Transaction&gt;
                              &lt;VersionNumber&gt;1.1&lt;/VersionNumber&gt;
                              &lt;Number&gt;30074&lt;/Number&gt;
                              &lt;SystemIdentifier&gt;LIFEHEALTH&lt;/SystemIdentifier&gt;
                              &lt;DestinationCode&gt;HEALTH263&lt;/DestinationCode&gt;
                              &lt;ClientCountryCode&gt;ZA&lt;/ClientCountryCode&gt;
                              &lt;Timestamp TimeZone=&quot;Africa/Johannesburg&quot;&gt;20200705123456&lt;/Timestamp&gt;
                              &lt;TestIndicator&gt;Y&lt;/TestIndicator&gt;
                              &lt;User&gt;CIMSZW/Jane Doe&lt;/User&gt;
                          &lt;/Transaction&gt;
                          &lt;MembershipLookup&gt;
                              &lt;IncludeDetail&gt;Y&lt;/IncludeDetail&gt;
                              &lt;Funder&gt;CIMSZWA&lt;/Funder&gt;
                              &lt;WithMembershipNumber&gt;
                                  &lt;MembershipNumber&gt;11117374&lt;/MembershipNumber&gt;
                                  &lt;DependentCode&gt;00&lt;/DependentCode&gt;
                              &lt;/WithMembershipNumber&gt;
                          &lt;/MembershipLookup&gt;
                      &lt;/Request&gt;
                  &lt;/Member&gt;
              &lt;/apac:request&gt;
          &lt;/apac:process&gt;
      &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  <p>Hw do I create the  SOAP envelope and the Header part with the Security Key Token</p>