title: c# WSDL without Header but requested
body: <p>Even if the application is similar to one made recently, rephrase in the correct terms, maybe I can better understand what my problem, since I have so far tried unsuccessfully a solution and the ones I found were not for the My case</p>
  
  <p>Abstract: first time I'm dealing with web service, soap, appurtenances, so forgive me ignorance absolute. (Also for the bad english)</p>
  
  <p>I have a wsdl on a web server institutional written in java that does NOT contain the client and the various calls no header, but it always requires, for each call.</p>
  
  <p>Problem: I create the client quietly with the endpoint, I connect to the web server responds to me and I read all the parameters (which I do not need anything) of the server. (So ​​I created the tunnel)</p>
  
  <p>Just try to make a call using any of the wsdl, type wsdl.result res = wsdl.getvalore (parameters), I always get errors due to the lack of the header in the message, for example: Private key is not in the X.509 certificate. (But NOT required private key to feel the support of the web service) or No Security Header.</p>
  
  <p>Following the example of the soap message in XML. For the part BODY no problem, but how do I add the header?
  Thanks to everyone who can help me out.
  Regards.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
   &lt;soapenv:Header&gt;
    &lt;wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" soapenv:mustUnderstand="1"&gt;
     &lt;wsu:Timestamp wsu:Id="TS-3"&gt;
      &lt;wsu:Created&gt;2014-09-09T08:23:50.725Z&lt;/wsu:Created&gt;
      &lt;wsu:Expires&gt;2014-09-09T08:28:50.725Z&lt;/wsu:Expires&gt;
     &lt;/wsu:Timestamp&gt;
     &lt;wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="X509-00000000000000000000000000000000"&gt;qtgOKG92iPHI/XLXGxFmg6Vnqmdg=&lt;/wsse:BinarySecurityToken&gt;
     &lt;ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="SIG-4"&gt;
      &lt;ds:SignedInfo&gt;
       &lt;ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"&gt;
        &lt;ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="soapenv"/&gt;
       &lt;/ds:CanonicalizationMethod&gt;
       &lt;ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/&gt;
       &lt;ds:Reference URI="#TS-3"&gt;
        &lt;ds:Transforms&gt;
         &lt;ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"&gt;
          &lt;ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsse soapenv"/&gt;
         &lt;/ds:Transform&gt;
        &lt;/ds:Transforms&gt;
        &lt;ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/&gt;
        &lt;ds:DigestValue&gt;hK3A/dZmQfIGDx9p7/8zV31iWDQ=&lt;/ds:DigestValue&gt;
       &lt;/ds:Reference&gt;
      &lt;/ds:SignedInfo&gt;
      &lt;ds:SignatureValue&gt;JlWXCRS6NEz9pl5gD9PBedQj6OMxBDXkLhIwGjncl4IsC1DzPoIVEJmIp/D679ba+pi692gvGpLn&lt;/ds:SignatureValue&gt;
      &lt;ds:KeyInfo Id="KI-00000000000000000000000000000000"&gt;
       &lt;wsse:SecurityTokenReference wsu:Id="STR-00000000000000000000000000000000"&gt;
        &lt;wsse:Reference URI="#X509-00000000000000000000000000000000" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/&gt;
       &lt;/wsse:SecurityTokenReference&gt;
      &lt;/ds:KeyInfo&gt;
     &lt;/ds:Signature&gt;
    &lt;/wsse:Security&gt;
   &lt;/soapenv:Header&gt;
   &lt;soapenv:Body&gt;
    &lt;scat:getPrescrizioneFirmata xmlns:scat="www.aaa.regione.it/Schemas/AAA_WEB/SERVICE/"&gt;
     &lt;scat:datiOperatore&gt;
      &lt;scat:codStruttura&gt;001001&lt;/scat:codStruttura&gt;
      &lt;scat:codiceFiscale&gt;PPPTTT00P01R000T&lt;/scat:codiceFiscale&gt;
      &lt;scat:ruoloIstituzionale&gt;Rrr000000&lt;/scat:ruoloIstituzionale&gt;
     &lt;/scat:datiOperatore&gt;
     &lt;scat:datiApplicativo&gt;
      &lt;scat:applDigest&gt;gredfgggjnbhtdybvvhghggvvbvb=&lt;/scat:applDigest&gt;
      &lt;scat:created&gt;2014-09-09T10:23:522+0200&lt;/scat:created&gt;
      &lt;scat:nome&gt;ABC&lt;/scat:nome&gt;
      &lt;scat:nonce&gt;ZQJzbirixuhvfa8NtoQa&lt;/scat:nonce&gt;
      &lt;scat:produttore&gt;PIPPO&lt;/scat:produttore&gt;
      &lt;scat:versione&gt;20.03&lt;/scat:versione&gt;
     &lt;/scat:datiApplicativo&gt;
     &lt;scat:identificativoRicetta&gt;001001001001001&lt;/scat:identificativoRicetta&gt;
    &lt;/scat:getPrescrizioneFirmata&gt;
   &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;​</code></pre>
  </div>
  </div>
  </p>