Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 如何将BinarySecurityToken获取到wcf soap请求中_Asp.net_Wcf - Fatal编程技术网

Asp.net 如何将BinarySecurityToken获取到wcf soap请求中

Asp.net 如何将BinarySecurityToken获取到wcf soap请求中,asp.net,wcf,Asp.net,Wcf,我需要向第三方签署soap请求。提供了一个调用应该是什么样子的示例。我正在尝试,但没有成功地打电话给wcf。 我需要进行WCFSOAP调用,其中标头包含BinarySecurityToken、Signature和SecurityTokenReference 这是他们发给我的一个例子(省略了一些值),我有一个签名证书,但我一辈子都搞不清楚如何使它工作 <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:so

我需要向第三方签署soap请求。提供了一个调用应该是什么样子的示例。我正在尝试,但没有成功地打电话给wcf。 我需要进行WCFSOAP调用,其中标头包含BinarySecurityToken、Signature和SecurityTokenReference

这是他们发给我的一个例子(省略了一些值),我有一个签名证书,但我一辈子都搞不清楚如何使它工作

<?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>

…省略。。
…省略。。。
…省略。。
123

我们最终得到了一个来自microsoft的修补程序和一些自定义类

有可能包含您的方法和修补程序详细信息。抱歉,Andrew太久了,方法太复杂了,我一辈子都不能给您提供详细信息。我有这个确切的问题。如果您能将答案发布在这里,我将不胜感激。对不起,Ryan,但是微软专门为我们制作了一个补丁,恐怕我们不允许共享。