title: how to consume java webservice from .net and wcf
body: <p>I am stuck with an interoperatibility issue. I am from .net and have to consume a Java Secured Service by signing request using x509 certificate. I have WSDL and generated service reference in .net wcf client and added x509 certificate credentials in app.config but the client does not generate the expected SOAP Payload (traced in fiddler) and java service throws error. Is there a way WCF client generate payload as expected by java? </p>
  
  <p>Below is the Working Request Payload given by Java Guys.</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:smok="http://www.javaServer.org/schemas/SmokeTest" 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"&gt;
        &lt;ds:Signature Id="SIG-53" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&gt;
          &lt;ds:SignedInfo&gt;
            &lt;ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"&gt;
              &lt;ec:InclusiveNamespaces PrefixList="smok soapenv" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/&gt;
            &lt;/ds:CanonicalizationMethod&gt;
            &lt;ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/&gt;
            &lt;ds:Reference URI="#id-52"&gt;
              &lt;ds:Transforms&gt;
                &lt;ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"&gt;
                  &lt;ec:InclusiveNamespaces PrefixList="smok" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/&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;dCnj2a+0wptrFSyWzEgwetSTHmM=&lt;/ds:DigestValue&gt;
            &lt;/ds:Reference&gt;
          &lt;/ds:SignedInfo&gt;
          &lt;ds:SignatureValue&gt;
            WgD3P8DWPG4eWXzXiD9+LZosn7ggRPpIC1OAmq9bn0s1HuGhM/fZozfDhEDn5sAF9RtVFiAZxC03
            4tW+cuxC5jAHH4GYQud6s5h5sGwvhLshQNVdI6HBBFQWr+J3mUEBbUCExJ6HEe1i2v0+dMQNWezo
            E1Ot7klNGxXedHzrlZw=
          &lt;/ds:SignatureValue&gt;
          &lt;ds:KeyInfo Id="KI-DE6BE13CF8D5419B66135109740345572"&gt;
            &lt;wsse:SecurityTokenReference wsu:Id="STR-DE6BE13CF8D5419B66135109740345573"&gt;
              &lt;ds:X509Data&gt;
                &lt;ds:X509IssuerSerial&gt;
                  &lt;ds:X509IssuerName&gt;CN=VeriSign Class 1 Individual Subscriber CA - G3,OU=Persona Not Validated,OU=Terms of use at https://www.verisign.com/rpa (c)09,OU=VeriSign Trust Network,O=VeriSign\, Inc.,C=US&lt;/ds:X509IssuerName&gt;
                  &lt;ds:X509SerialNumber&gt;51921456535433584705342517836423530149&lt;/ds:X509SerialNumber&gt;
                &lt;/ds:X509IssuerSerial&gt;
              &lt;/ds:X509Data&gt;
            &lt;/wsse:SecurityTokenReference&gt;
          &lt;/ds:KeyInfo&gt;
        &lt;/ds:Signature&gt;
      &lt;/wsse:Security&gt;
    &lt;/soapenv:Header&gt;
    &lt;soapenv:Body wsu:Id="id-52" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;
      &lt;smok:HelloRequest&gt;
        &lt;smok:Name&gt;Hello from Heruwala&lt;/smok:Name&gt;
      &lt;/smok:HelloRequest&gt;
    &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>