Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.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 SAML 2.0工件解析发送请求接收响应_C#_Xml_Soap_Saml 2.0 - Fatal编程技术网

C# 无法通过soap SAML 2.0工件解析发送请求接收响应

C# 无法通过soap SAML 2.0工件解析发送请求接收响应,c#,xml,soap,saml-2.0,C#,Xml,Soap,Saml 2.0,我正在研究SAML2.0。我在尝试向idp请求工件解析时遇到以下错误 无法通过soap发送请求接收响应:“元”开始标记 第5行的位置6与“头部”的末端标记不匹配。第12行, 立场3 以下是向idp请求工件解析的代码: Saml2ArtifactType0004 httpArtifact = Saml2ArtifactType0004.CreateFromHttpArtifactHttpForm(context.Request); // Saml2ArtifactType0004 httpArti

我正在研究SAML2.0。我在尝试向idp请求工件解析时遇到以下错误

无法通过soap发送请求接收响应:“元”开始标记 第5行的位置6与“头部”的末端标记不匹配。第12行, 立场3

以下是向idp请求工件解析的代码:

Saml2ArtifactType0004 httpArtifact = Saml2ArtifactType0004.CreateFromHttpArtifactHttpForm(context.Request);
// Saml2ArtifactType0004 httpArtifact = Saml2ArtifactType0004.CreateFromHttpArtifactQueryString(System.Web.HttpContext.Current.Request);
// Create an artifact resolve request.
ArtifactResolve artifactResolve = new ArtifactResolve();
artifactResolve.Issuer = new Issuer(Util.GetAbsoluteUrl(System.Web.HttpContext.Current, "~/"));
artifactResolve.Artifact = new Artifact(httpArtifact.ToString());

// Send the artifact resolve request and receive the artifact response.
string spArtifactResponderUrl = WebConfigurationManager.AppSettings["ArtifactIdProviderUrl"];

ArtifactResponse artifactResponse = ArtifactResponse.SendSamlMessageReceiveAftifactResponse(spArtifactResponderUrl, artifactResolve);

// Extract the authentication request from the artifact response.
samlResponse = new Response(artifactResponse.Message);
relayState = httpArtifact.RelayState;
工件解析xml如下所示:

<saml:ArtifactResolve ID="_37DBE1945FEE46AFA8760669A9E35A71" Version="2.0" IssueInstant="2016-06-07T05:53:15.756Z" xmlns:saml="urn:oasis:names:tc:SAML:2.0:protocol"><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">http://localhost:1426/</saml:Issuer><samlp:Artifact xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">AAQAAErbp/tMatqZ/zZ4dvK10H8AAAAAvYu+k6ffUkCCUnLjx2ixkwAAAAA=</samlp:Artifact></saml:ArtifactResolve>
http://localhost:1426/AAQAAErbp/tMatqZ/zZ4dvK10H8AAAAAvYu+K6FFUKCCNLJX2IXKwaaaa=
有人能帮我纠正这个错误吗