2010-02-19 31 views
1

我需要我簽字的SOAP請求到第三方。提供了一個例子,呼叫應該是什麼樣子。我正在嘗試使用wcf進行此調用,但沒有成功。 我需要在頭部包含BinarySecurityToken,Signature和SecurityTokenReference的情況下進行wcf soap調用。如何獲得的BinarySecurityToken進入WCF SOAP請求

這裏是他們給我(有一些省略的數值)我有簽名的證書的例子,但我不能爲我的生活弄清楚如何使這項工作

<?xml version="1.0" encoding="UTF-8"?> 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 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" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> 

<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="SecurityToken-..omitted.." xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">..omitted..</wsse:BinarySecurityToken> 

<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> 
    <ds:SignedInfo> 
    <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> 
    <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> 
    <ds:Reference URI="#Body"> 
     <ds:Transforms> 
     <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> 
     </ds:Transforms> 
     <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> 
     <ds:DigestValue>..omitted...</ds:DigestValue> 
    </ds:Reference> 
    </ds:SignedInfo> 
    <ds:SignatureValue> 
    ..omitted.. 
    </ds:SignatureValue> 
<ds:KeyInfo><wsse:SecurityTokenReference><wsse:Reference URI="#SecurityToken-..omitted.." ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soapenv:Header><soapenv:Body wsu:Id="Body"><in0 xmlns="http://test.3rdParty.com">123</in0></soapenv:Body></soapenv:Envelope> 

回答

-3

我們結束與來自微軟和一些自定義類

+2

,包括你的方法,並修補程序細節的任何機會修補程序。 – 2011-02-03 09:56:54

+0

對不起,安德魯公司一直以長,方法是如此令人費解的我不能爲我的生命給你的細節 – 2011-02-04 02:19:52

+0

我有這個確切的問題。如果您可以在此發佈答案,我將非常感激。 – 2011-11-25 17:40:07