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
C# 我正试图找出我的杂烩出了什么问题。我得到一个错误';散列值不匹配';作为soap响应_C#_Wcf - Fatal编程技术网

C# 我正试图找出我的杂烩出了什么问题。我得到一个错误';散列值不匹配';作为soap响应

C# 我正试图找出我的杂烩出了什么问题。我得到一个错误';散列值不匹配';作为soap响应,c#,wcf,C#,Wcf,我正试图找出我的杂烩出了什么问题。我收到一个错误“哈希值不匹配”作为soap响应 服务器日志实际上抱怨abt这个散列值?摘要价值 <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> <SignedInfo> <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c1

我正试图找出我的杂烩出了什么问题。我收到一个错误“哈希值不匹配”作为soap响应

服务器日志实际上抱怨abt这个散列值?摘要价值

     <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
            <SignedInfo>
              <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
              <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
              <Reference URI="#_1">
                <Transforms>
                  <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                </Transforms>
                <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                <DigestValue>l6kqP048t5INzJT3W8gxVSXplaE=</DigestValue>
              </Reference>

So Now I am trying to compare this DigestValue  with my code computed hash. 
Not sure how else I could try to fix this 
2) 这是我请求的实际内容。所以它是加密和签名的

 string ToCompare = @"ISA*00*00*ZZ*400034 *ZZ*100000 0507*1750*^*00501**IL*1*PELEYTAY*JAVIER~REF*SY*5~DMG*D8*1981*M~DTP*291*RD8*20130115-20130115~EQ*30~SE*14*0001~GE*1*456452~IEA*1*526208405~";
byte[] tmpNewHash;
tmpNewHash = new MD5CryptoServiceProvider().ComputeHash(tmpSource);
bool bEqual = false;
if (tmpNewHash.Length == tmpHash.Length)
{
    int i=0;
    while ((i < tmpNewHash.Length) && (tmpNewHash[i] == tmpHash[i]))
    {
        i += 1;
    }
    if (i == tmpNewHash.Length) 
    {
        bEqual = true;
    }
}
string to compare=@“ISA*00*00*ZZ*400034*ZZ*100000 0507*1750*^*00501**IL*1*PELEYTAY*JAVIER~REF*SY*5~DMG*D8*1981*M~DTP*291*RD8*20130115-20130115~EQ*30~SE*14*0001~GE*1*4564552~IEA*1*526208405~”;
字节[]tmpnewahsh;
tmpNewHash=新的MD5CryptoServiceProvider().ComputeHash(tmpSource);
bool-bEqual=false;
if(tmpNewHash.Length==tmpHash.Length)
{
int i=0;
而((i
我能比较一下这两个吗?。我理解正确吗?
否则我将如何比较哈希?

标记中会显示语言选择,而不是问题的标题。签名是不必要的;您的签名卡已显示。感谢您花时间编辑我的问题。。你介意回答这个问题吗?我不知道答案。可能这里有其他人这样做。哈希值不匹配。。签名者状态:“已从格式为x509的BinarySecurityToken中提取证书链。”哈希值不匹配。我的服务器有链式证书,用户证书不是链式证书。加密使用服务器完成,并使用usercert进行签名。。usercert中的私钥会有问题吗\
 string ToCompare = @"ISA*00*00*ZZ*400034 *ZZ*100000 0507*1750*^*00501**IL*1*PELEYTAY*JAVIER~REF*SY*5~DMG*D8*1981*M~DTP*291*RD8*20130115-20130115~EQ*30~SE*14*0001~GE*1*456452~IEA*1*526208405~";
byte[] tmpNewHash;
tmpNewHash = new MD5CryptoServiceProvider().ComputeHash(tmpSource);
bool bEqual = false;
if (tmpNewHash.Length == tmpHash.Length)
{
    int i=0;
    while ((i < tmpNewHash.Length) && (tmpNewHash[i] == tmpHash[i]))
    {
        i += 1;
    }
    if (i == tmpNewHash.Length) 
    {
        bEqual = true;
    }
}