none
How configure my wcf client to call SOAP service hosted by tomcat? RRS feed

  • Question

  • Hi,
    I need to configure my WCF client to call SOAP service hosted by Apache.
    The SOAP messages must be signed using X509 certificate; I have generate the certificate using openssl tool.
    This is an example of SOAP message that the server accepts.
    How can I configure my client to produce this kind of message?

    Thanks

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
      <soap:Header>
        <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" soap:mustUnderstand="true">
          <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="SIG-D69C45B37E9FA67245143680341109322">
            <ds:SignedInfo>
              <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="soap"/>
              </ds:CanonicalizationMethod>
              <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
              <ds:Reference URI="#TS-D69C45B37E9FA67245143680341109213">
                <ds:Transforms>
                  <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                    <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsse soap"/>
                  </ds:Transform>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                <ds:DigestValue>gOaxPixf9SD3O2WkuoG+wNhchmlxrRKPoSAVd63uoAM=</ds:DigestValue>
              </ds:Reference>
              <ds:Reference URI="#id-D69C45B37E9FA67245143680341109317">
                <ds:Transforms>
                  <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                    <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList=""/>
                  </ds:Transform>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                <ds:DigestValue>BMv26GCWz32FEKrlU/yW3ngFk5XXLaUT46sA6W1rPNk=</ds:DigestValue>
              </ds:Reference>
              <ds:Reference URI="#UsernameToken-D69C45B37E9FA67245143680341109212">
                <ds:Transforms>
                  <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                    <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="soap"/>
                  </ds:Transform>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                <ds:DigestValue>FmGVauzSw5rbjDfiQIN+3QZeWcJkWNb2l2f/3vIgs2g=</ds:DigestValue>
              </ds:Reference>
              <ds:Reference URI="#id-D69C45B37E9FA67245143680341109318">
                <ds:Transforms>
                  <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                    <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList=""/>
                  </ds:Transform>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                <ds:DigestValue>xSjezIxwygKwiwgPJhu+kqHeLFC4XcnoEZqD5/5+50Y=</ds:DigestValue>
              </ds:Reference>
              <ds:Reference URI="#id-D69C45B37E9FA67245143680341109319">
                <ds:Transforms>
                  <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                    <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="soap"/>
                  </ds:Transform>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                <ds:DigestValue>mECrcFqjwXQI08Mg0FXmacUCjjMv7KalmKB2uYW8SJk=</ds:DigestValue>
              </ds:Reference>
              <ds:Reference URI="#id-D69C45B37E9FA67245143680341109320">
                <ds:Transforms>
                  <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                    <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList=""/>
                  </ds:Transform>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                <ds:DigestValue>4GGNdXFJCJX8NqjqBYHu+kFMN6+G4NZNJhx3quYpEwI=</ds:DigestValue>
              </ds:Reference>
              <ds:Reference URI="#id-D69C45B37E9FA67245143680341109321">
                <ds:Transforms>
                  <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                    <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="soap"/>
                  </ds:Transform>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                <ds:DigestValue>GZQzCV1KX1ticpmyxTjRgj/ntWwpF3MjbC5Ml6yinL0=</ds:DigestValue>
              </ds:Reference>
            </ds:SignedInfo>
            <ds:SignatureValue>.......</ds:SignatureValue>
            <ds:KeyInfo Id="KI-D69C45B37E9FA67245143680341109215">
              <wsse:SecurityTokenReference wsu:Id="STR-D69C45B37E9FA67245143680341109216">
                <wsse:KeyIdentifier 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/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">.......</wsse:KeyIdentifier>
              </wsse:SecurityTokenReference>
            </ds:KeyInfo>
          </ds:Signature>
          <wsu:Timestamp wsu:Id="TS-D69C45B37E9FA67245143680341109213">
            <wsu:Created>2015-07-13T16:03:31.092Z</wsu:Created>
            <wsu:Expires>2015-07-13T16:08:31.092Z</wsu:Expires>
          </wsu:Timestamp>
          <wsse:UsernameToken wsu:Id="UsernameToken-D69C45B37E9FA67245143680341109212">
            <wsse:Username>.....</wsse:Username>
          </wsse:UsernameToken>
        </wsse:Security>
        <Action xmlns="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" soap:mustUnderstand="true" wsu:Id="id-D69C45B37E9FA67245143680341109318">urn:aMethod</Action>
        <MessageID xmlns="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-D69C45B37E9FA67245143680341109319">urn:uuid:eb7a01c1-d879-4d52-a7a1-0ef38a69927e</MessageID>
        <To xmlns="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" soap:mustUnderstand="true" wsu:Id="id-D69C45B37E9FA67245143680341109320">......</To>
        <ReplyTo xmlns="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-D69C45B37E9FA67245143680341109321">
          <Address>http://www.w3.org/2005/08/addressing/anonymous</Address>
        </ReplyTo>
      </soap:Header>
      <soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-D69C45B37E9FA67245143680341109317">
        <ns2:aMethod xmlns:ns2="http://acompany.com/">
          <aMethodData>
            <param1>.....</param1>
            <param2>.........</param2>
          </aMethodData>
        </ns2:aMethod>
      </soap:Body>
    </soap:Envelope>
    

    Friday, September 18, 2015 12:08 PM

Answers