C# c中来自wsdl的soap消息中的头#

C# c中来自wsdl的soap消息中的头#,c#,soap,header,wsdl,C#,Soap,Header,Wsdl,到目前为止,我使用了web服务上公开的政府服务,使用了提供的wsdl,没有任何问题。 通过连接到服务并使用document类,我获得以下请求: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis- open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&qu

到目前为止,我使用了web服务上公开的政府服务,使用了提供的wsdl,没有任何问题。 通过连接到服务并使用document类,我获得以下请求:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis- 
open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- 
wssecurity-secext-1.0.xsd">
<u:Timestamp u:Id="uuid-d5d2f565-9027-4da9-9354-8803db695be7-1"><u:Created>2020-11- 
05T07:35:56.762Z</u:Created><u:Expires>2020-11-05T07:40:56.762Z</u:Expires></u:Timestamp>
<o:BinarySecurityToken u:Id="uuid-7de78e07-4175-4b70-85a1-a153ae5b4da7-2" 
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" 
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security- 
1.0#Base64Binary">canceled now because it is too long</o:BinarySecurityToken>
<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="#uuid-d5d2f565-9027-4da9-9354-8803db695be7-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>uTP02nd8WZ5d77mUz5XZqcaFo9U=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>canceled now because it is too long</SignatureValue><KeyInfo> 
<o:SecurityTokenReference><o:Reference ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401- 
wss-x509-token-profile-1.0#X509v3" URI="#uuid-7de78e07-4175-4b70-85a1-a153ae5b4da7-2"/> 
</o:SecurityTokenReference></KeyInfo></Signature></o:Security>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<addDocument xmlns="http://www.sist.puglia.it/Schemas/PDD_SIST/SCATEL/FSE/">
    <document>
        <document>canceled now because it is too long</document>
        <documentName>NameOfDocument</documentName>
    <status>Approved</status>
    </document>
    <repositoryDocumentURI><documentID>123456</documentID><localNode>localnode</localNode><regionalNode>IT-75</regionalNode></repositoryDocumentURI>
</addDocument>
</s:Body>
</s:Envelope>

2020-11- 
05T07:35:56.762Z2020-11-05T07:40:56.762Z
现在取消了,因为它太长了
uTP02nd8WZ5d77mUz5XZqcaFo9U=
现在取消了,因为它太长了
现在取消了,因为它太长了
文件名称
经核准的
123456localnodeIT-75
但是他们给我的例子,我希望是正确的,在标题部分是完全不同的,有一系列的断言,我不知道如何插入到我的标题中。例如:

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
    <saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" saml:ID="identity-assertion" saml:IssueInstant="2020-01-08T18:24:26.000Z" saml:Version="2.0" wsu:Id="identity-assertion" xsi:schemaLocation="urn:oasis:names:tc:SAML:2.0:assertion saml-schema-assertion-2.0.xsd">
        <saml:Issuer>ClientIssuer</saml:Issuer>
        <saml:Subject>
            <saml:NameID>1234567890.mycomp.it</saml:NameID>
        </saml:Subject>
        <saml:Conditions NotBefore="2020-05-26T08:55:16Z" NotOnOrAfter="2020-05-26T09:00:16Z"/>
        <saml:AuthnStatement AuthnInstant="2020-05-26T08:55:16Z">
            <saml:AuthnContext>
                <saml:AuthnContextDecl/>
                <saml:AuthenticatingAuthority/>
            </saml:AuthnContext>
        </saml:AuthnStatement>
        <saml:AttributeStatement/>
    </saml:Assertion>
    <saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" saml:ID="authorization-assertion" saml:IssueInstant="2020-01-08T18:24:26.000Z" saml:Version="2.0" wsu:Id="authorization-assertion" xsi:schemaLocation="urn:oasis:names:tc:SAML:2.0:assertion saml-schema-assertion-2.0.xsd">
        <saml:Issuer>ClientIssuer</saml:Issuer>
        <saml:Subject>
            <saml:NameID>1234567890.mycomp.it</saml:NameID>
        </saml:Subject>
        <saml:Conditions NotBefore="2020-05-26T08:55:16Z" NotOnOrAfter="2020-05-26T09:00:16Z"/>
        <saml:AuthzDecisionStatement Decision="Permit" Resource="https://pddasl-coll.rmmg.rsr.rupar.puglia.it:8181/aslba/IDocumentService">
            <saml:Action Namespace="http://www.sist.puglia.it/Schemas/PDD_SIST/SCATEL/FSE/">addDocument</saml:Action>
        </saml:AuthzDecisionStatement>
    </saml:Assertion>
    <saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" saml:ID="applicative-assertion" saml:IssueInstant="2020-01-08T18:24:26.000Z" saml:Version="2.0" wsu:Id="applicative-assertion" xsi:schemaLocation="urn:oasis:names:tc:SAML:2.0:assertion saml-schema-assertion-2.0.xsd">
        <saml:Issuer>ClientIssuer</saml:Issuer>
        <saml:Subject>
            <saml:NameID>1234567890</saml:NameID>
        </saml:Subject>
        <saml:Conditions NotBefore="2020-05-26T08:55:16Z" NotOnOrAfter="2020-05-26T08:55:16Z"/>
        <saml:AuthnStatement AuthnInstant="2020-05-26T08:55:16Z">
            <saml:AuthnContext>
                <saml:AuthnContextDecl/>
                <saml:AuthenticatingAuthority/>
            </saml:AuthnContext>
        </saml:AuthnStatement>
        <saml:AttributeStatement>
            <saml:Attribute Name="urn:oasis:names:tc:sist:1.0:subject:subject-application-id" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">program</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:sist:1.0:subject:subject-application-vendor" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">producer</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:sist:1.0:subject:subject-application-version" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">3</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:sist:1.0:subject:subject-application-nonce" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">l1x3wk1nuWr6WFZ0vTXO</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:sist:1.0:subject:subject-application-created" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">2020-05-26T08:55:16Z</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:sist:1.0:subject:subject-application-digest" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">exC6bLX8oBreK1Dvx8BmZHpaoCU=</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:xacml:1.0:subject:subject-id" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">05897456898</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:organization-id" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">160123</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:xspa:1.0:subject:organization" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">ASL WORLD</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:xacml:1.0:action:action-id" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">C</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:xacml:2.0:subject:role" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">RIS000055</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:xacml:1.0:resource:resource-id" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xsi:type="xs:string">asdert56y76u777i</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:xspa:1.0:resource:hl7:type" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">223344-2</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:xspa:1.0:environment:locality" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">123456 - CLIENT OF WEB SERVICE"</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:xspa:1.0:resource:patient:hl7:confidentiality-code" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">false</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute Name="urn:oasis:names:tc:xspa:1.0:resource:patient:consent" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
                <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">true</saml:AttributeValue>
            </saml:Attribute>
        </saml:AttributeStatement>
    </saml:Assertion>
    <wsa:Action xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" soapenv:mustUnderstand="1">http://www.sist.puglia.it/Schemas/PDD_SIST/SCATEL/FSE/addDocument</wsa:Action>
    <wsa:ReplyTo xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" soapenv:mustUnderstand="1">
        <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
    </wsa:ReplyTo>
    <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">https://pddasl-coll.rmmg.rsr.rupar.puglia.it:8181/aslba/IDocumentService</wsa:To>
    <wsa:FaultTo xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" soapenv:mustUnderstand="1">
        <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
    </wsa:FaultTo>
    <wsa:MessageID xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" soapenv:mustUnderstand="1">uuid:F1625E20-8969-428F-8FCC-26A7EBFAE6BB</wsa:MessageID>
</s:Header>
<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <addDocument xmlns="http://www.sist.puglia.it/Schemas/PDD_SIST/SCATEL/FSE/">
        <document>
            <document>canceled now because it is too long</document>
            <documentName>doc_43139T2V1</documentName>
            <status>Approved</status>
            <binaryDocument>canceled now because it is too long</binaryDocument>
            <binaryName>doc_43139T2V1.pdf</binaryName>
        </document>
    </addDocument>
</s:Body>
</s:Envelope>

客户问题
1234567890.mycomp.it
客户问题
1234567890.mycomp.it
添加文档
客户问题
1234567890
程序
制作人
3.
l1x3wk1nuWr6WFZ0vTXO
2020-05-26T08:55:16Z
exC6bLX8oBreK1Dvx8BmZHpaoCU=
05897456898
160123
ASL世界
C
RIS000055
asdert56y76u777i
223344-2
123456-WEB服务的客户端“
假的
真的
http://www.sist.puglia.it/Schemas/PDD_SIST/SCATEL/FSE/addDocument
http://www.w3.org/2005/08/addressing/anonymous
https://pddasl-coll.rmmg.rsr.rupar.puglia.it:8181/aslba/IDocumentService
http://www.w3.org/2005/08/addressing/anonymous
uuid:F1625E20-8969-428F-8FCC-26A7EBFAE6BB
现在取消了,因为它太长了
文件号:43139T2V1
经核准的
现在取消了,因为它太长了
doc_43139T2V1.pdf
在wsdl类中,我有一个名为samlAssertion的类,它可能用于在报头中插入必要的行,但我不知道如何使用它,也不知道如何将生成的行与报头中已经自动存在的行连接起来。 我该怎么做?建议我不要使用wsdl,而是用另一种方式