- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我面临的问题,需要一些帮助/指导。
我已经从我的引擎生成了一个 XML 消息,这需要被解析为一个服务。为此,我必须将该消息更改为 SOAP 消息并在其上插入 SAML token 。我正在尝试使用 C# 代码执行此操作。以下是我生成的输入消息及其预期输出:
输入信息:
删除输入消息,因为它已插入到 SOAP 主体中
期望的输出信息:
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope
xmlns:S="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsse11="http://docs.oasisopen.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"
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-wsswssecurity-utility-1.0.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
xmlns:exc14n="http://www.w3.org/2001/10/xml-exc-c14n#">
<S:Header>
<To mustUnderstand="true"
xmlns="http://www.w3.org/2005/08/addressing">https://localhost:443/Gateway/PatientDiscovery/1_0/NwHINService/NwHINPatientDiscovery
</To>
<Action mustUnderstand="true"
xmlns="http://www.w3.org/2005/08/addressing">urn:hl7-org:v3:PRPA_IN201305UV02:CrossGatewayPatientDiscovery
</Action>
<ReplyTo mustUnderstand="true"
xmlns="http://www.w3.org/2005/08/addressing">
<Address>http://www.w3.org/2005/08/addressing/anonymous</Address>
</ReplyTo>
<MessageID mustUnderstand="true"
xmlns="http://www.w3.org/2005/08/addressing">461433e3-4591-453b-9eb6-791c7f5ff882
</MessageID>
<wsse:Security S:mustUnderstand="true">
<wsu:Timestamp wsu:Id="_1"
xmlns:ns17="http://docs.oasis-open.org/ws-sx/wssecureconversation/200512"
xmlns:ns16="http://schemas.xmlsoap.org/soap/envelope/">
<wsu:Created>2012-06-08T18:31:44Z</wsu:Created>
<wsu:Expires>2012-06-08T18:36:44Z</wsu:Expires>
</wsu:Timestamp>
<saml2:Assertion ID="_e1154a8a-bbd5-426d-afa5-ed7071f1b1ff" IssueInstant="2012-06-08T18:31:44.577Z" Version="2.0"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:exc14n="http://www.w3.org/2001/10/xml-excc14n#"
xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<saml2:Issuer Format="urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName">CN=SAML User,OU=SU,O=SAML User,L=Los Angeles,ST=CA,C=US</saml2:Issuer>
<ds:Signature
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-excc14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsasha1"/>
<ds:Reference URI="#_e1154a8a-bbd5-426d-afa5-ed7071f1b1ff">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-excc14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>5MearYAjQTErf01u/7UlKo2hEyc=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>eCEFcl9iEl6u0MrAehJdsRrgbOCnirOE8i9IQpYMb25sMEaeLzXR7SFGf+TrPyv87YwYUr8lP1xK
Iohggt9yCkdvsVIOhRxiOQmK36ATjIsCNVdjqQwH2Ez9q9esRPgWIlS0vDRKxylaz1eGEX5ZCGdg
rBuScX3uvVjA5s/SVfQh6Enw9cbW/1i5Vcrvrie9ro2EdNS6CM1qLmf9bY37E5XK3f3Zt2xne1TH
OXyqH9jXU5RdE14vD+jNHAjCLq61rG5+ImWtZ2sYmp8+vLJGOVSH6yUEDV2v04AdsXUYbjgRvMjo
/mC8Mec2LdX0pGAuqS+hF4xdlR4RNI74Jj7Esg==</ds:SignatureValue>
<ds:KeyInfo>
<ds:KeyValue>
<ds:RSAKeyValue>
<ds:Modulus>maFp5lsEHjhrQQCL0e8cbxMoDpGk1r6Uion/LA2iuD3T+sspJh8TNToQrurpFFVY/u6IzHKIk64s
9894pxbwYNwv/LzRVzM5pOXmCT73KGAg3Cry+QOO5KrN8hR/OXyH90/LIS77FZY+bepqD6qx4URa
2/GLll08fu8xh1wPFDMCFAmb2Xz/5gK0fimUXJAWi1+PlNKMLnDGxHgvz5ZwiN1/QwXcQEc1mcJC
imLoiCSrk7nvmqkxX4ZZ1dYzQJWdlB8Om4r9Uu96q5cZFTYwSdivLpPFKSzn/2MI9NryZC0VaIBu
HRhgAmspAzM90BjLO5vtiwrrfx/E3uYcMjcSEQ==</ds:Modulus>
<ds:Exponent>AQAB</ds:Exponent>
</ds:RSAKeyValue>
</ds:KeyValue>
</ds:KeyInfo>
</ds:Signature>
<saml2:Subject>
<saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameidformat:X509SubjectName">UID=WilmaAnderson</saml2:NameID>
<saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:holder-ofkey">
<saml2:SubjectConfirmationData>
<ds:KeyInfo>
<ds:KeyValue>
<ds:RSAKeyValue>
<ds:Modulus>maFp5lsEHjhrQQCL0e8cbxMoDpGk1r6Uion/LA2iuD3T+sspJh8TNToQrurpFFVY/u6IzHKIk64s9894pxbwYNwv/LzRVz
M5pOXmCT73KGAg3Cry+QOO5KrN8hR/OXyH90/LIS77FZY+bepqD6qx4URa2/GLll08fu8xh1wPFDMCFAmb2Xz/5gK0fimUXJAWi1+PlNKML
nDGxHgvz5ZwiN1/QwXcQEc1mcJCimLoiCSrk7nvmqkxX4ZZ1dYzQJWdlB8Om4r9Uu96q5cZFTYwSdivLpPFKSzn/2MI9NryZC0VaIBuHRhg
AmspAzM90BjLO5vtiwrrfx/E3uYcMjcSEQ==</ds:Modulus>
<ds:Exponent>AQAB</ds:Exponent>
</ds:RSAKeyValue>
</ds:KeyValue>
</ds:KeyInfo>
</saml2:SubjectConfirmationData>
</saml2:SubjectConfirmation>
</saml2:Subject>
<saml2:AuthnStatement AuthnInstant="2012-06-08T18:31:44.577Z" SessionIndex="123456">
<saml2:AuthnContext>
<saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:X509</saml2:AuthnContextClassRef>
</saml2:AuthnContext>
</saml2:AuthnStatement>
<saml2:AttributeStatement>
<saml2:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:subject-id">
<saml2:AttributeValue ns6:type="ns7:string"
xmlns:ns6="http://www.w3.org/2001/XMLSchemainstance"
xmlns:ns7="http://www.w3.org/2001/XMLSchema">WilmaWA Anderson
</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:organization">
<saml2:AttributeValue ns6:type="ns7:string"
xmlns:ns6="http://www.w3.org/2001/XMLSchemainstance"
xmlns:ns7="http://www.w3.org/2001/XMLSchema">2.16.840.1.113883.3.609.10.330.000
</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:organization-id">
<saml2:AttributeValue ns6:type="ns7:string"
xmlns:ns6="http://www.w3.org/2001/XMLSchemainstance"
xmlns:ns7="http://www.w3.org/2001/XMLSchema">2.16.840.1.113883.3.609.10.330.000
</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="urn:NwHIN:names:saml:homeCommunityId">
<saml2:AttributeValue ns6:type="ns7:string"
xmlns:ns6="http://www.w3.org/2001/XMLSchemainstance"
xmlns:ns7="http://www.w3.org/2001/XMLSchema">2.16.840.1.113883.3.609.10.330.000
</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="urn:oasis:names:tc:xacml:2.0:subject:role">
<saml2:AttributeValue>
<hl7:Role code="46255001" codeSystem="2.16.840.1.113883.6.96"
codeSystemName="SNOMED_CT" displayName="Pharmacist" xsi:type="hl7:CE"
xmlns:hl7="urn:hl7-org:v3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:purposeofuse">
<saml2:AttributeValue>
<hl7:PurposeOfUse code="OPERATIONS" codeSystem="2.16.840.1.113883.3.18.7.1" codeSystemName="NwHIN-purpose" displayName="Healthcare Operations" xsi:type="hl7:CE"
xmlns:hl7="urn:hl7-org:v3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="urn:oasis:names:tc:xacml:2.0:resource:resource-id">
<saml2:AttributeValue ns6:type="ns7:string"
xmlns:ns6="http://www.w3.org/2001/XMLSchemainstance"
xmlns:ns7="http://www.w3.org/2001/XMLSchema">PATAA000000040^^^&2.16.840.1.113883.3.609.20.330.000&ISO
</saml2:AttributeValue>
</saml2:Attribute>
</saml2:AttributeStatement>
</saml2:Assertion>
<ds:Signature Id="_2"
xmlns:ns17="http://docs.oasis-open.org/ws-sx/wssecureconversation/200512"
xmlns:ns16="http://schemas.xmlsoap.org/soap/envelope/">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<exc14n:InclusiveNamespaces PrefixList="wsse S"/>
</ds:CanonicalizationMethod>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#_1">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<exc14n:InclusiveNamespaces PrefixList="wsu wsse S"/>
</ds:Transform>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>wOyuouXyvOr9+wFonBcY/sfKQdc=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>L3DLzs6axzNlKUuySKvg52ljw+QrLkmJLbJH7kyHoafjyUavzmw3IPAsg70UfVS8tpM+ut7Im4ouqn9eVOttY2BY8MTyBGUSlwj/2IGHdzxoqcXpLFXxx7ntti2Zt/mfmnV1A+iu+a0l5uIRBy6OdxbSsZg1yK2UYaR60WkVEXVH1MZXnHmE33woHjrScvXh1i
mdJ8apZzCuWZ4Nlbf85kvwVjriyCOK2O1nUvY7ZmSsuHGqTOrgemoDQxlNKb3F4Rn48W1yIiAAAJZuq2Qx5KJ4b6aX17/M73pqvqTKMz5Wv
YrmL54FzhXIalns6LzAZ6EZo4YdYOODmuchIZwZqg==</ds:SignatureValue>
<ds:KeyInfo>
<wsse:SecurityTokenReference wsse11:TokenType="http://docs.oasisopen.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0">
<wsse:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wsssaml-token-profile-1.1#SAMLID">_e1154a8a-bbd5-426d-afa5-ed7071f1b1ff</wsse:KeyIdentifier>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
</wsse:Security>
</S:Header>
<S:Body>
<ns6:PRPA_IN201305UV02 ITSVersion="XML_1.0"
xmlns:ns2="urn:oasis:names:tc:ebxmlregrep:xsd:rim:3.0"
xmlns:ns3="urn:oasis:names:tc:ebxmlregrep:xsd:rs:3.0"
xmlns:ns4="http://www.hhs.gov/healthit/NwHIN"
xmlns:ns5="urn:oasis:names:tc:ebxmlregrep:xsd:query:3.0"
xmlns:ns6="urn:hl7-org:v3"
xmlns:ns7="urn:gov:hhs:fha:NwHINc:common:NwHINccommon"
xmlns:ns8="urn:gov:hhs:fha:NwHINc:common:patientcorrelationfacade"
xmlns:ns9="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<ns6:id root="2.16.840.1.113883.3.609.20.330.000" extension="-5a3e95b1:11d1fa33d45:-7f9b"/>
<ns6:creationTime value="20120608143143"/>
<ns6:interactionId root="2.16.840.1.113883.1.6" extension="PRPA_IN201305UV02"/>
<ns6:processingCode code="T"/>
<ns6:processingModeCode code="T"/>
<ns6:acceptAckCode code="AL"/>
<ns6:receiver typeCode="RCV">
<ns6:device classCode="DEV" determinerCode="INSTANCE">
<ns6:id root="2.16.840.1.113883.3.609.10.330.002"/>
<ns6:asAgent classCode="AGNT">
<ns6:representedOrganization classCode="ORG" determinerCode="INSTANCE">
<ns6:id root="2.16.840.1.113883.3.609.10.330.002"/>
</ns6:representedOrganization>
</ns6:asAgent>
</ns6:device>
</ns6:receiver>
<ns6:sender typeCode="SND">
<ns6:device classCode="DEV" determinerCode="INSTANCE">
<ns6:asAgent classCode="AGENT">
<ns6:representedOrganization classCode="ORG" determinerCode="INSTANCE">
<ns6:id root="2.16.840.1.113883.3.609.10.330.000"/>
</ns6:representedOrganization>
</ns6:asAgent>
</ns6:device>
</ns6:sender>
<ns6:controlActProcess classCode="CACT" moodCode="EVN">
<ns6:code code="PRPA_TE201305UV02" codeSystem="2.16.840.1.113883.1.6"/>
<ns6:authorOrPerformer typeCode="AUT">
<ns6:assignedDevice>
<ns6:id root="2.16.840.1.113883.3.609.20.330.000"/>
</ns6:assignedDevice>
</ns6:authorOrPerformer>
<ns6:queryByParameter>
<ns6:queryId root="2.16.840.1.113883.3.609.10.330.000" extension="-abd3453dcd24wkkks545"/>
<ns6:statusCode code="new"/>
<ns6:responseModalityCode code="R"/>
<ns6:responsePriorityCode code="I"/>
<ns6:parameterList>
<ns6:livingSubjectAdministrativeGender>
<ns6:value code="M"/>
<ns6:semanticsText representation="TXT"/>
</ns6:livingSubjectAdministrativeGender>
<ns6:livingSubjectBirthTime>
<ns6:value value="19350213"/>
<ns6:semanticsText representation="TXT"/>
</ns6:livingSubjectBirthTime>
<ns6:livingSubjectId>
<ns6:value root="2.16.840.1.113883.3.609.20.330.000" extension="PATAA000000040"/>
<ns6:semanticsText representation="TXT"/>
</ns6:livingSubjectId>
<ns6:livingSubjectId>
<ns6:value root="2.16.840.1.113883.4.1" extension=""/>
<ns6:semanticsText representation="TXT"/>
</ns6:livingSubjectId>
<ns6:livingSubjectName>
<ns6:value>
<ns6:prefix partType="PFX"/>
<ns6:given partType="GIV">Test</ns6:given>
<ns6:given partType="GIV"/>
<ns6:family partType="FAM">Testing</ns6:family>
<ns6:suffix partType="PFX"/>
</ns6:value>
<ns6:semanticsText representation="TXT"/>
</ns6:livingSubjectName>
<ns6:patientAddress>
<ns6:value/>
</ns6:patientAddress>
<ns6:patientTelecom>
<ns6:value value=""/>
<ns6:semanticsText representation="TXT"/>
</ns6:patientTelecom>
</ns6:parameterList>
</ns6:queryByParameter>
</ns6:controlActProcess>
</ns6:PRPA_IN201305UV02>
</S:Body>
</S:Envelope>
使用 X509 证书我可以创建签名部分。但是,我无法创建 SAML 断言和 SOAP 消息。如果有人可以帮助/指导我,那将是一个很大的帮助。这是我在 C# 中的代码:
删除我的代码,因为它已经是主代码库的一部分
近期输出
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsse11="http://docs.oasisopen.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"
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-wsswssecurity-utility-1.0.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
xmlns:exc14n="http://www.w3.org/2001/10/xml-exc-c14n#">
<soap:Header>
<To mustUnderstand="true"
xmlns="http://www.w3.org/2005/08/addressing">https://localhost:443/Gateway/PatientDiscovery/1_0/NwHINService/NwHINPatientDiscovery
</To>
<Action mustUnderstand="true"
xmlns="http://www.w3.org/2005/08/addressing">urn:hl7-org:v3:PRPA_IN201305UV02:CrossGatewayPatientDiscovery
</Action>
<ReplyTo mustUnderstand="true"
xmlns="http://www.w3.org/2005/08/addressing">
<Address>http://www.w3.org/2005/08/addressing/anonymous</Address>
</ReplyTo>
<MessageID mustUnderstand="true"
xmlns="http://www.w3.org/2005/08/addressing">461433e3-4591-453b-9eb6-791c7f5ff882
</MessageID>
<wsse:Security soap:mustUnderstand="true">
<wsu:Timestamp wsu:Id="_1"
xmlns:ns17="http://docs.oasis-open.org/ws-sx/wssecureconversation/200512"
xmlns:ns16="http://schemas.xmlsoap.org/soap/envelope/">
<wsu:Created>2012-06-08T18:31:44Z</wsu:Created>
<wsu:Expires>2012-06-08T18:36:44Z</wsu:Expires>
</wsu:Timestamp>
<saml2:Assertion ID="_883e64a747a5449b83821913a2b189e6" IssueInstant="2017-10-20T05:09:31.369Z" Version="2.0"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:exc14n="http://www.w3.org/2001/10/xml-excc14n#"
xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<saml2:Issuer Format="urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName">CN=SAML User,OU=SU,O=SAML User,L=Los Angeles,ST=CA,C=US
<Signature
xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>I/0YHptWQW4Y+32HZ8sypXfjPr0=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>j3nJoKFny0wdeZZtVKt0XGoL/RC10EJWjqRK8RXzZxU9Uhh/c/0RafmnX4Ed/usVDKhdH+XXYnLVASiKpe5q372yhrMs8709C8OCwV4TZSpmAUUakIad3FZTf5kSH/GrAvtBRAbf9qfm2P5eQvl0OW7fI7/fyyaTi+p2sHuIyUSE/sPdbeQFH2nhxCAIVDI5tuiC7RuCHucPdmHZf6RvywONSP1mrr+ar2UTbadsprAHSMfy/k6kEm7Uy+hcE0MZnEcWipNtzeYmSai0pE6sUNtHigmUQLcbky/fSdQnjNyVDU4cwNMuryx6Zj8jfOxNEELqj338WP4UhLcy7Yggug==</SignatureValue>
<KeyInfo>
<X509Data>
<X509Certificate>MIIEZTCCA02gAwIBAgIJAMOJ3N+F0yoBMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJEQzETMBEGA1UEBxMKV2FzaGluZ3RvbjESMBAGA1UEChMJQ29nbml6YW50MR0wGwYDVQQLExRTb2Z0d2FyZSBFbmdpbmVlcmluZzEaMBgGA1UEAxMRd3d3LmNvZ25pemFudC5jb20wHhcNMTcxMDExMDUwMzQ4WhcNMTgxMDExMDUwMzQ4WjB+MQswCQYDVQQGEwJVUzELMAkGA1UECBMCREMxEzARBgNVBAcTCldhc2hpbmd0b24xEjAQBgNVBAoTCUNvZ25pemFudDEdMBsGA1UECxMUU29mdHdhcmUgRW5naW5lZXJpbmcxGjAYBgNVBAMTEXd3dy5jb2duaXphbnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwjIFT5mA4jIxXUilmH56Xk2n44vWaiVDR9KfsdKYUeGO/y0f0aUn+cwBeB7zR9Il8YLgaNh1dVvShvlwm31kWTD+dnTrnHB8pMHYh7Y5k7zSLeLgZolWqm+kpEBnre5MLwa2O+Thy6skpmr3sGE+t7mSibEptYSf1lfB2qCHUXYf+jfAJdNuXo3pJsPGsXwU0L1KPnUJIRMs4l4b8JvwZO3cj2eOSGd5JGDCSYG2w+o/Cgyq/A5iDMVgtsyds5kp3JIvhfqXmxhZxkmiTHm4AOglkTY96v7eptDZ0+yspt5p2H5fU1loVwLXQHnk8lXqV3gF+JD8iUEcNrwEX6xbNQIDAQABo4HlMIHiMB0GA1UdDgQWBBSHY9xnAIinZJNFNq7A5dVaa9D0FjCBsgYDVR0jBIGqMIGngBSHY9xnAIinZJNFNq7A5dVaa9D0FqGBg6SBgDB+MQswCQYDVQQGEwJVUzELMAkGA1UECBMCREMxEzARBgNVBAcTCldhc2hpbmd0b24xEjAQBgNVBAoTCUNvZ25pemFudDEdMBsGA1UECxMUU29mdHdhcmUgRW5naW5lZXJpbmcxGjAYBgNVBAMTEXd3dy5jb2duaXphbnQuY29tggkAw4nc34XTKgEwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAp0hd/qIbFUpdCAzY9K3/PKGOjlKJn6npyeeE4+jYandvpbxvPo00XCY+pvdLBejoPjnsNjgVYl5Y41SdI2hNP7F65h3BjG3C8AsA98KFIZrBaTaTiLk2B8Tr2Q7MSUcHSEbcs1uSUA8Uzmk4NdJICkLrLKgrWdRBKVyigZi+rD1vD4LTsQoVzQqBD8K8p8h5stOH0x1l5NxTsn3M6o4Q86fGzFLNDK2KUok7AcFl7I17l5DuOYgzIvqgQzCgQ+V/4alJ7dfkVOSqH/0oar5yDCLYjlXtMkqUQlLnni2NSLDmMJfWQ8HWJaAMAhu1hbG9LrUqN4/Xue6tyuWz+i0+0Q==</X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
<subject
xmlns="saml2">
<saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameidformat:X509SubjectName">UID=WilmaAnderson</saml2:NameID>
<saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:holder-ofkey">
<saml2:SubjectConfirmationData>
<KeyInfo
xmlns="">
<X509Data>
<X509Certificate>MIIEZTCCA02gAwIBAgIJAMOJ3N+F0yoBMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJEQzETMBEGA1UEBxMKV2FzaGluZ3RvbjESMBAGA1UEChMJQ29nbml6YW50MR0wGwYDVQQLExRTb2Z0d2FyZSBFbmdpbmVlcmluZzEaMBgGA1UEAxMRd3d3LmNvZ25pemFudC5jb20wHhcNMTcxMDExMDUwMzQ4WhcNMTgxMDExMDUwMzQ4WjB+MQswCQYDVQQGEwJVUzELMAkGA1UECBMCREMxEzARBgNVBAcTCldhc2hpbmd0b24xEjAQBgNVBAoTCUNvZ25pemFudDEdMBsGA1UECxMUU29mdHdhcmUgRW5naW5lZXJpbmcxGjAYBgNVBAMTEXd3dy5jb2duaXphbnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwjIFT5mA4jIxXUilmH56Xk2n44vWaiVDR9KfsdKYUeGO/y0f0aUn+cwBeB7zR9Il8YLgaNh1dVvShvlwm31kWTD+dnTrnHB8pMHYh7Y5k7zSLeLgZolWqm+kpEBnre5MLwa2O+Thy6skpmr3sGE+t7mSibEptYSf1lfB2qCHUXYf+jfAJdNuXo3pJsPGsXwU0L1KPnUJIRMs4l4b8JvwZO3cj2eOSGd5JGDCSYG2w+o/Cgyq/A5iDMVgtsyds5kp3JIvhfqXmxhZxkmiTHm4AOglkTY96v7eptDZ0+yspt5p2H5fU1loVwLXQHnk8lXqV3gF+JD8iUEcNrwEX6xbNQIDAQABo4HlMIHiMB0GA1UdDgQWBBSHY9xnAIinZJNFNq7A5dVaa9D0FjCBsgYDVR0jBIGqMIGngBSHY9xnAIinZJNFNq7A5dVaa9D0FqGBg6SBgDB+MQswCQYDVQQGEwJVUzELMAkGA1UECBMCREMxEzARBgNVBAcTCldhc2hpbmd0b24xEjAQBgNVBAoTCUNvZ25pemFudDEdMBsGA1UECxMUU29mdHdhcmUgRW5naW5lZXJpbmcxGjAYBgNVBAMTEXd3dy5jb2duaXphbnQuY29tggkAw4nc34XTKgEwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAp0hd/qIbFUpdCAzY9K3/PKGOjlKJn6npyeeE4+jYandvpbxvPo00XCY+pvdLBejoPjnsNjgVYl5Y41SdI2hNP7F65h3BjG3C8AsA98KFIZrBaTaTiLk2B8Tr2Q7MSUcHSEbcs1uSUA8Uzmk4NdJICkLrLKgrWdRBKVyigZi+rD1vD4LTsQoVzQqBD8K8p8h5stOH0x1l5NxTsn3M6o4Q86fGzFLNDK2KUok7AcFl7I17l5DuOYgzIvqgQzCgQ+V/4alJ7dfkVOSqH/0oar5yDCLYjlXtMkqUQlLnni2NSLDmMJfWQ8HWJaAMAhu1hbG9LrUqN4/Xue6tyuWz+i0+0Q==</X509Certificate>
</X509Data>
</KeyInfo>
</saml2:SubjectConfirmationData>
</saml2:SubjectConfirmation>
</subject>
</saml2:Issuer>
<saml2:AuthnStatement AuthnInstant="2017-10-20T05:09:31.369Z" SessionIndex="123456">
<saml2:AuthnContext>
<saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:X509</saml2:AuthnContextClassRef>
</saml2:AuthnContext>
</saml2:AuthnStatement>
<saml2:AttributeStatement>
<saml2:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:subject-id" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
<saml2:AttributeValue
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">WilmaWA Anderson
</saml2:AttributeValue>
</saml2:Attribute>
</saml2:AttributeStatement>
<saml2:AttributeStatement>
<saml2:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:organization" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
<saml2:AttributeValue
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Developer Integration Lab
</saml2:AttributeValue>
</saml2:Attribute>
</saml2:AttributeStatement>
<saml2:AttributeStatement>
<saml2:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:organization-id" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
<saml2:AttributeValue
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">https://lab.dil.aegis.net
</saml2:AttributeValue>
</saml2:Attribute>
</saml2:AttributeStatement>
<saml2:AttributeStatement>
<saml2:Attribute Name="urn:nhin:names:saml:homeCommunityId" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
<saml2:AttributeValue
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">urn:oid:2.16.840.1.113883.3.7477.4522.1
</saml2:AttributeValue>
</saml2:Attribute>
</saml2:AttributeStatement>
<saml2:AttributeStatement>
<saml2:Attribute Name="urn:oasis:names:tc:xacml:2.0:subject:role" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
<saml2:AttributeValue>
<hl7:Role
xmlns:hl7="urn:hl7-org:v3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" code="112247003" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED_CT" displayName="Medical doctor" xsi:type="CE" />
</saml2:AttributeValue>
</saml2:Attribute>
</saml2:AttributeStatement>
<saml2:AttributeStatement>
<saml2:Attribute Name="urn:oasis:names:tc:xacml:2.0:subject:role" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
<saml2:AttributeValue>
<hl7:PurposeOfUse
xmlns:hl7="urn:hl7-org:v3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" code="TREATMENT" codeSystem="2.16.840.1.113883.3.18.7.1" codeSystemName="nhin-purpose" displayName="Treatment" xsi:type="CE" />
</saml2:AttributeValue>
</saml2:Attribute>
</saml2:AttributeStatement>
</saml2:Assertion>
<wsu:Timestamp wsu:ID="">
<wsu:Created>"2017-10-20T05:09:31.369Z"</wsu:Created>
<wsu:Expires>"2017-10-20T05:09:31.369Z"</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<PRPA_IN201305UV02
xmlns="urn:hl7-org:v3"
xmlns:ns2="urn:gov:hhs:fha:nhinc:common:nhinccommon"
xmlns:ns3="http://www.w3.org/2005/08/addressing"
xmlns:ns4="urn:gov:hhs:fha:nhinc:common:patientcorrelationfacade"
xmlns:ns5="http://www.hhs.gov/healthit/nhin"
xmlns:ns6="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"
xmlns:ns7="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
xmlns:ns8="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" ITSVersion="XML_1.0" nullFlavor="">
<id extension="50a6fe29-cfd5-45ef-8cbe-67e567c9a23c" nullFlavor="" root="2.16.840.1.113883.3.89.102.15.30" />
<creationTime nullFlavor="" value="20150309171201" />
<interactionId extension="PRPA_IN201305UV02" nullFlavor="" root="2.16.840.1.113883.1.6" />
<processingCode code="T" nullFlavor="" />
<processingModeCode code="T" nullFlavor="" />
<acceptAckCode code="NE" nullFlavor="" />
<receiver typeCode="RCV">
<device classCode="DEV" determinerCode="INSTANCE">
<id root="2.16.840.1.113883.3.1259.10.1003" />
<asAgent classCode="AGNT">
<representedOrganization classCode="ORG" determinerCode="INSTANCE">
<id root="2.16.840.1.113883.3.1259.10.1003" />
</representedOrganization>
</asAgent>
</device>
</receiver>
<sender nullFlavor="" typeCode="SND">
<device classCode="DEV" determinerCode="INSTANCE" nullFlavor="">
<id nullFlavor="" root="2.16.840.1.113883.3.89.102.15.30" />
<asAgent classCode="AGNT" nullFlavor="">
<representedOrganization classCode="ORG" determinerCode="INSTANCE" nullFlavor="">
<id nullFlavor="" root="2.16.840.1.113883.3.89.102.15.30" />
</representedOrganization>
</asAgent>
</device>
</sender>
<controlActProcess classCode="CACT" moodCode="EVN" nullFlavor="">
<code code="PRPA_TE201305UV02" codeSystem="2.16.840.1.113883.1.6" nullFlavor="" />
<authorOrPerformer nullFlavor="" typeCode="AUT">
<assignedDevice classCode="ASSIGNED" nullFlavor="">
<id nullFlavor="" root="2.16.840.1.113883.3.89.102.15.50" />
</assignedDevice>
</authorOrPerformer>
<queryByParameter nullFlavor="">
<queryId extension="ee72b41a-4eb6-4eb0-ab74-0d4ea29dd1b2" nullFlavor="" root="2.16.840.1.113883.3.89.102.15.30" />
<statusCode code="new" nullFlavor="" />
<responseModalityCode code="R" nullFlavor="" />
<responsePriorityCode code="I" nullFlavor="" />
<parameterList nullFlavor="">
<livingSubjectAdministrativeGender nullFlavor="">
<value code="M" nullFlavor="" />
<semanticsText nullFlavor="" />
</livingSubjectAdministrativeGender>
<livingSubjectBirthTime nullFlavor="">
<value nullFlavor="" value="19600210" />
<semanticsText nullFlavor="" />
</livingSubjectBirthTime>
<livingSubjectId nullFlavor="">
<value extension="1000131023" nullFlavor="" root="2.16.840.1.113883.3.89.102.15.50" />
<semanticsText nullFlavor="" />
</livingSubjectId>
<livingSubjectName nullFlavor="">
<value nullFlavor="" use="">
<given partType="GIV" qualifier="">Test</given>
<given partType="GIV" qualifier="">M</given>
<family partType="FAM" qualifier="">Testing</family>
</value>
<semanticsText nullFlavor="" />
</livingSubjectName>
</parameterList>
</queryByParameter>
</controlActProcess>
</PRPA_IN201305UV02>
</soap:Body>
</soap:Envelope>
最佳答案
尝试以下:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography.Xml;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace Certificate
{
class Program
{
const string FILENAME = @"c:\temp\test.xml";
static void Main(string[] args)
{
XmlDocument doc = new XmlDocument();
CreateSoap(doc);
XmlElement assertion = (XmlElement)(doc.GetElementsByTagName("saml2:Assertion")[0]);
XmlElement security = (XmlElement)(doc.GetElementsByTagName("wsse:Security")[0]); //added 10-20-17
XmlElement body = (XmlElement)(doc.GetElementsByTagName("soap:Body")[0]);
using (WebClient client = new WebClient())
{
byte[] xmlBytes = client.DownloadData(FILENAME);
body.InnerXml = Encoding.UTF8.GetString(xmlBytes);
}
string pfxpath = @"D:\Certificate\Private-cert.pfx";
X509Certificate2 cert = new X509Certificate2(File.ReadAllBytes(pfxpath), "123456789");
SignXmlWithCertificate(assertion, cert);
SignXmlWithCertificate(security, cert); //added 10-20-17
XmlElement subject = doc.CreateElement("Subject", "saml2");
assertion.AppendChild(subject);
CreateSubject(subject);
File.WriteAllText(@"D:\Certificate\digitallysigned.xml", doc.OuterXml);
}
public static void CreateSoap(XmlDocument doc)
{
DateTime date = DateTime.Now;
string soap = string.Format(
"<?xml version=\"1.0\"?>" +
"<soap:Envelope" +
" xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\"" +
" xmlns:wsse11=\"http://docs.oasisopen.org/wss/oasis-wss-wssecurity-secext-1.1.xsd\"" +
" 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-wsswssecurity-utility-1.0.xsd\"" +
" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"" +
" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\"" +
" xmlns:saml=\"urn:oasis:names:tc:SAML:1.0:assertion\"" +
" xmlns:exc14n=\"http://www.w3.org/2001/10/xml-exc-c14n#\">" +
"<soap:Header>" +
"<To mustUnderstand=\"true\"" +
" xmlns=\"http://www.w3.org/2005/08/addressing\">https://localhost:443/Gateway/PatientDiscovery/1_0/NwHINService/NwHINPatientDiscovery" +
"</To>" +
"<Action mustUnderstand=\"true\"" +
" xmlns=\"http://www.w3.org/2005/08/addressing\">urn:hl7-org:v3:PRPA_IN201305UV02:CrossGatewayPatientDiscovery" +
"</Action>" +
"<ReplyTo mustUnderstand=\"true\"" +
" xmlns=\"http://www.w3.org/2005/08/addressing\">" +
"<Address>http://www.w3.org/2005/08/addressing/anonymous</Address>" +
"</ReplyTo>" +
"<MessageID mustUnderstand=\"true\"" +
" xmlns=\"http://www.w3.org/2005/08/addressing\">461433e3-4591-453b-9eb6-791c7f5ff882" +
"</MessageID>" +
"<wsse:Security soap:mustUnderstand=\"true\">" +
"<wsu:Timestamp wsu:Id=\"_1\"" +
" xmlns:ns17=\"http://docs.oasis-open.org/ws-sx/wssecureconversation/200512\"" +
" xmlns:ns16=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
"<wsu:Created>2012-06-08T18:31:44Z</wsu:Created>" +
"<wsu:Expires>2012-06-08T18:36:44Z</wsu:Expires>" +
"</wsu:Timestamp>" +
"<saml2:Assertion ID=\"_883e64a747a5449b83821913a2b189e6\" IssueInstant=\"{0}\" Version=\"2.0\"" +
" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\"" +
" xmlns:exc14n=\"http://www.w3.org/2001/10/xml-excc14n#\"" +
" xmlns:saml2=\"urn:oasis:names:tc:SAML:2.0:assertion\"" +
" xmlns:xenc=\"http://www.w3.org/2001/04/xmlenc#\"" +
" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">" +
"<saml2:Issuer Format=\"urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName\">CN=SAML User,OU=SU,O=SAML User,L=Los Angeles,ST=CA,C=US" +
"</saml2:Issuer>" +
"</saml2:Assertion>" +
"</wsse:Security>" +
"</soap:Header>" +
"<soap:Body>" +
"</soap:Body>" +
"</soap:Envelope>",
date.ToUniversalTime().ToString("yyyy-MM-ddThh:mm:ss.fffZ"));
//date format
//2015-03-09T21:12:02.279Z
doc.LoadXml(soap);
}
public static void SignXmlWithCertificate(XmlElement assertion, X509Certificate2 cert)
{
SignedXml signedXml = new SignedXml(assertion);
signedXml.SigningKey = cert.PrivateKey;
Reference reference = new Reference();
reference.Uri = "";
reference.AddTransform(new XmlDsigEnvelopedSignatureTransform());
signedXml.AddReference(reference);
KeyInfo keyInfo = new KeyInfo();
keyInfo.AddClause(new KeyInfoX509Data(cert));
signedXml.KeyInfo = keyInfo;
signedXml.ComputeSignature();
XmlElement xmlsig = signedXml.GetXml();
assertion.AppendChild(xmlsig);
}
public static void CreateSubject(XmlElement xSubject)
{
string subject = "<saml2:NameID Format=\"urn:oasis:names:tc:SAML:1.1:nameidformat:X509SubjectName\">UID=WilmaAnderson</saml2:NameID>" +
"<saml2:SubjectConfirmation Method=\"urn:oasis:names:tc:SAML:2.0:cm:holder-ofkey\">" +
"<saml2:SubjectConfirmationData>" +
"<ds:KeyInfo>" +
"<ds:KeyValue>" +
"<ds:RSAKeyValue>" +
"<ds:Modulus>" +
"maFp5lsEHjhrQQCL0e8cbxMoDpGk1r6Uion/LA2iuD3T+sspJh8TNToQrurpFFVY/u6IzHKIk64s9894pxbwYNwv/LzRVz" +
"M5pOXmCT73KGAg3Cry+QOO5KrN8hR/OXyH90/LIS77FZY+bepqD6qx4URa2/GLll08fu8xh1wPFDMCFAmb2Xz/5gK0fimUXJAWi1+PlNKML" +
"nDGxHgvz5ZwiN1/QwXcQEc1mcJCimLoiCSrk7nvmqkxX4ZZ1dYzQJWdlB8Om4r9Uu96q5cZFTYwSdivLpPFKSzn/2MI9NryZC0VaIBuHRhg" +
"AmspAzM90BjLO5vtiwrrfx/E3uYcMjcSEQ==" +
"</ds:Modulus>" +
"<ds:Exponent>AQAB</ds:Exponent>" +
"</ds:RSAKeyValue>" +
"</ds:KeyValue>" +
"</ds:KeyInfo>" +
"</saml2:SubjectConfirmationData>" +
"</saml2:SubjectConfirmation>";
xSubject.InnerXml = subject;
}
}
}
关于c# - 使用 C# 的 XML 中的 SAML 断言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46722997/
我有以下实体字段: /** * @Assert\Regex( * pattern = "/^d+\.(jpg|png|gif)$/", * htmlPattern = "/^d+\.(j
我有一个显示查询结果的表。 我使用这个检查表包含结果: cy.get("table", {timeout: 60000}).find("tr[data-index]").should("have.le
void (assert)(int e) { assert(e); } 这里是如何工作的? 最佳答案 void (assert)(int e) 相当于 void assert(int) 为什么
大家好,我的第一次测试遇到了一些问题 我正在写这个 fragment ,但我一直遇到这个问题: java.lang.AssertionError at org.junit.Assert.fail(As
从表中,我获取字符串列表,并想检查当 val!= "A"时,表列表中是否存在字符串“x”: for (int i = 0; i list = new ArrayList(); for(int i=0
我想在现有代码中为 VHDL 断言操作添加一个错误计数器。基本上,我的代码如下所示: assert data = good_data report "Bad data" severity er
我有一个无法处理的问题,所以我想也许你可以帮助我。基本上我有一个函数,它接收 char* 作为参数并对其执行一些操作(我已经检查了这些步骤/函数,它们工作得很好)。如果函数中给出的 char* 是“”
我有一些代码用于检查输入日期是否正确。只需检查是否不超过 12 个月,给定月份中的日期是否正确,并且还应该考虑闰年(因此,基本上是正常的日期检查)。唯一不合适的是年份不应低于 2000。如果日期无效,
我有一个关于 Cypress 断言的问题,最近才开始使用这个测试平台,但是当 URL 返回一个随机数时卡住了,如下所示。 /Geocortex/Essentials/REST/sites/SITE?f
我有一个 Python mock对象,我想断言是否设置了该对象的任何属性。 我不相信PropertyMock将适用于我的目的,因为我必须知道是否设置了任何属性,而不是特定属性。 它也不像我可以模拟模拟
考虑这个简单的基类 Foo 有一个函数 foo 调用一个纯虚函数 foo_,用 Doxygen 记录: class Foo { public: /** \brief This functi
关闭。这个问题需要debugging details .它目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and th
我在这段代码中执行 malloc 时遇到问题, /*function starts*/ if(NULL==(partial_results=(bignum_t**)malloc(sizeof
大家好,我想知道如何将整个代码块放入一个断言中? 例如,我有一个数组,我想对数组的每个值进行断言。这是我的代码的样子: for (int value : values) { assert Wi
这不是我的作业——我只是在练习。我似乎无法完全理解这个断言概念。 1) Determine the pre-condition for x that guarantees the post-condi
是否可以在带有时间戳的断言失败时记录信息 例如 int a = 10 assert( a > 100 ); 那么它将失败并像时间戳一样输出 2013-12-02 , 17:00:05 assert f
由于我们公司不使用单元测试,所以我正在自学对自己的代码进行单元测试。我正在使用标准的 .net 测试框架进行一些非常基本的单元测试。 我的一个方法返回一个 IEnumerable我想测试它的输出。所以
我有一个如下所示的对象数组,并且只想针对数组中的某些字段进行断言。 对象数组 - var a = [{"key":"key2","value":"value2","updatedBy":"name1"
我正在尝试编写一个 PSL 断言来检查输入断言的数量是否与输出断言的数量相匹配。 例如: . 在输入上任何时候都可能发生任何事情,输出也可以在任何时候断言。确切时间未知,也不重要。我要验证的是没有信息
我想在Cypress中做一个断言如下: cy.get(a).should('be.visible').or(()=>{ cy.get(b).should('be.visible'); });
我是一名优秀的程序员,十分优秀!