0

既然我终于能够分别通过 1105 和 1122 进行批量传输服务,我将支持 1105 进行状态请求。我已经重复使用代码来签名和生成我的 http 请求,所以应该没有太多问题。以下是我发送的数据包,格式和值已编辑。

            POST /core/ws/lite/a2a/test/here/there HTTP/1.1
            Content-Encoding: gzip
            Accept-Encoding: gzip,deflate
            Content-Type: multipart/related; type="application/xop+xml"; start="<root_part>"; boundary="--=_part_60cb735e-c276-4405-834a-50d9b589636e"; start-info="text/xml"
            SOAPAction: "RequestSubmissionStatusDetail"
            MIME-Version: 1.0
            Host: la.www4.irs.gov
            Connection: Keep-Alive
            Expect: 100-Continue
            Content-Length: 3177


            ----=_part_60cb735e-c276-4405-834a-50d9b589636e
            Content-Type: application/xop+xml; charset=utf-8; type="text/xml"
            Content-Transfer-Encoding: binary
            Content-Id: <root_part>

            <?xml version="1.0" encoding="UTF-8" standalone="no"?>
            <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:us:gov:treasury:irs:msg:irstransmitterstatusrequest" xmlns:urn1="urn:us:gov:treasury:irs:ext:aca:air:ty18" xmlns:urn2="urn:us:gov:treasury:irs:common" xmlns:urn3="urn:us:gov:treasury:irs:msg:acasecurityheader">
                <env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
                    <wsse:Security 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">
                        <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="SIG-f2b7b3e293a642c58f7e48656be85b30">
                            <ds:SignedInfo>
                                <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments"/>
                                <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
                                <ds:Reference URI="#TS-b4302e87b74441b6bf13eeae3c13f124">
                                    <ds:Transforms>
                                        <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                                            <ds:InclusiveNamespaces xmlns:ds="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsse wsa env urn urn1 urn2 urn3"/>
                                        </ds:Transform>
                                    </ds:Transforms>
                                    <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                                    <ds:DigestValue>[DIGEST VALUE]</ds:DigestValue>
                                </ds:Reference>
                                <ds:Reference URI="#id-c6d0bbd68f5e40a493ed5462878a4fde">
                                    <ds:Transforms>
                                        <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                                            <ds:InclusiveNamespaces xmlns:ds="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsa env urn1 urn2"/>
                                        </ds:Transform>
                                    </ds:Transforms>
                                    <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                                    <ds:DigestValue>[DIGEST VALUE]</ds:DigestValue>
                                </ds:Reference>
                                <ds:Reference URI="#id-f57af9d1ed1640af89227d5878799924">
                                    <ds:Transforms>
                                        <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                                            <ds:InclusiveNamespaces xmlns:ds="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="env urn urn1 urn2 urn3"/>
                                        </ds:Transform>
                                    </ds:Transforms>
                                    <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                                    <ds:DigestValue>[DIGEST VALUE]</ds:DigestValue>
                                </ds:Reference>
                            </ds:SignedInfo>
                            <ds:SignatureValue>[SIGNATURE VALUE]</ds:SignatureValue>
                            <ds:KeyInfo Id="KI-f2b7b3e293a642c58f7e48656be85b30">
                                <wsse:SecurityTokenReference wsu:Id="STR-f2b7b3e293a642c58f7e48656be85b30">
                                    <wsse:KeyIdentifier 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">[CERT VALUE]</wsse:KeyIdentifier>
                                </wsse:SecurityTokenReference>
                            </ds:KeyInfo>
                        </ds:Signature>
                        <wsu:Timestamp wsu:Id="TS-b4302e87b74441b6bf13eeae3c13f124">
                            <wsu:Created>2019-03-20T21:28:01.017Z</wsu:Created>
                            <wsu:Expires>2019-03-20T21:38:01.017Z</wsu:Expires>
                        </wsu:Timestamp>
                    </wsse:Security>
                    <urn:ACABusinessHeader xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-c6d0bbd68f5e40a493ed5462878a4fde">
                        <urn1:UniqueTransmissionId>[UTID]</urn1:UniqueTransmissionId>
                        <urn2:Timestamp>2019-03-20T20:59:49Z</urn2:Timestamp>
                    </urn:ACABusinessHeader>
                    <urn3:ACASecurityHeader>
                        <urn2:UserId>[ASID]</urn2:UserId>
                    </urn3:ACASecurityHeader>
                    <wsa:Action>RequestSubmissionStatusDetail</wsa:Action>
                </env:Header>
                <env:Body>
                    <urn:ACABulkRequestTransmitterStatusDetailRequest xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" version="1.0" wsu:Id="id-f57af9d1ed1640af89227d5878799924">
                        <urn1:ACABulkReqTrnsmtStsReqGrpDtl>
                            <urn2:ReceiptId>[RECEIPT]</urn2:ReceiptId>
                        </urn1:ACABulkReqTrnsmtStsReqGrpDtl>
                    </urn:ACABulkRequestTransmitterStatusDetailRequest>
                </env:Body>
            </env:Envelope>
            ----=_part_60cb735e-c276-4405-834a-50d9b589636e--

我不确定从哪里开始解决这个问题,因为状态请求的文档比实际传输本身的文档更少。我知道我的签名和元素是有效的,尽管我不确定包含的名称空间。如果您使用过 5258 号出版物,您将知道传输服务的 2 个给定示例显示了 2 个不同的变化,其中一个来自上一年。状态请求只有一个例子,是去年的。我确定我的其他必要值是正确的,即 UserId 字段和唯一传输 ID,尽管此处已编辑。任何帮助在这里表示赞赏。

编辑——我知道 URL 是错误的,这只是一个内部端点,用于捕获 SSL 之外的流量。另外,我尝试了 8 位而不是二进制,因为这就是我们最终设置原始传输服务的方式。

4

2 回答 2

2

我已经将您发布的内容与我发送的内容进行了比较,我没有看到 XML 本身有太大的不同,我不记得 IRS 是否对这个请求的缩进很挑剔,但我目前在我发送的 SOAP 中没有缩进。

我没有使用任何 MTOM 边界发送它,我只是将 SOAP XML 读入 gzip 请求流并将其发送到 WSDL URL。

下面是我比较你的时发送的示例(从 Fiddler 的原始输出中获取并格式化,它没有以前的格式)

POST [URL] HTTP/1.1
Accept-Encoding: gzip, deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: RequestSubmissionStatusDetail
Host: la.www4.irs.gov
Content-Length: 6194
Expect: 100-continue
Connection: Keep-Alive

<soapenv:Envelope xmlns:oas1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:urn="urn:us:gov:treasury:irs:msg:irstransmitterstatusrequest" 
    xmlns:urn1="urn:us:gov:treasury:irs:ext:aca:air:ty18" 
    xmlns:urn2="urn:us:gov:treasury:irs:common" 
    xmlns:urn3="urn:us:gov:treasury:irs:msg:acasecurityheader">
    <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
        <wsse:Security 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">
            <Signature Id="SIG-D2FB25526C8348AD95E612881F40EB95" 
                xmlns="http://www.w3.org/2000/09/xmldsig#">
                <SignedInfo>
                    <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments" />
                    <SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
                    <Reference URI="#TS-200BDCDA5B0C4C468DFEB0581AA15570">
                        <Transforms>
                            <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                                <InclusiveNamespaces PrefixList="wsse wsa oas1 soapenv urn urn1 urn2 urn3" 
                                    xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" />
                            </Transform>
                        </Transforms>
                        <DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
                        <DigestValue>[VALUE]</DigestValue>
                    </Reference>
                    <Reference URI="#id-204B33EDA74348ACABB3B791BEBF97F2">
                        <Transforms>
                            <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                                <InclusiveNamespaces PrefixList="wsa oas1 soapenv urn1 urn2 urn3" 
                                    xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" />
                            </Transform>
                        </Transforms>
                        <DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
                        <DigestValue>[VALUE]</DigestValue>
                    </Reference>
                    <Reference URI="#id-D11B31E69B5B412EBA078A7C03C68D0D">
                        <Transforms>
                            <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                                <InclusiveNamespaces PrefixList="oas1 soapenv urn1 urn2 urn3" 
                                    xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" />
                            </Transform>
                        </Transforms>
                        <DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
                        <DigestValue>[VALUE]</DigestValue>
                    </Reference>
                </SignedInfo>
                <SignatureValue>[VALUE]</SignatureValue>
                <KeyInfo Id="KI-A5CB548510AE48DF96C37ADF55E71AE6">
                    <wsse:SecurityTokenReference wsu:Id="STR-2B2450C3AC8B46C990E1328C2B53473B">
                        <wsse:KeyIdentifier 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">[VALUE]</wsse:KeyIdentifier>
                    </wsse:SecurityTokenReference>
                </KeyInfo>
            </Signature>
            <wsu:Timestamp wsu:Id="TS-200BDCDA5B0C4C468DFEB0581AA15570">
                <wsu:Created>2019-03-22T18:11:32.991Z</wsu:Created>
                <wsu:Expires>2019-03-22T18:21:32.991Z</wsu:Expires>
            </wsu:Timestamp>
        </wsse:Security>
        <urn:ACABusinessHeader wsu:Id="id-204B33EDA74348ACABB3B791BEBF97F2" 
            xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <urn1:UniqueTransmissionId>[VALUE]</urn1:UniqueTransmissionId>
            <urn2:Timestamp>2019-03-22T18:11:32Z</urn2:Timestamp>
        </urn:ACABusinessHeader>
        <urn3:ACASecurityHeader>
            <urn2:UserId>[VALUE]</urn2:UserId>
        </urn3:ACASecurityHeader>
        <wsa:Action>RequestSubmissionStatusDetail</wsa:Action>
    </soapenv:Header>
    <soapenv:Body>
        <urn:ACABulkRequestTransmitterStatusDetailRequest version="1.0" wsu:Id="id-D11B31E69B5B412EBA078A7C03C68D0D" 
            xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <urn1:ACABulkReqTrnsmtStsReqGrpDtl>
                <urn2:ReceiptId>1094C-19-XXXXXXXX</urn2:ReceiptId>
            </urn1:ACABulkReqTrnsmtStsReqGrpDtl>
        </urn:ACABulkRequestTransmitterStatusDetailRequest>
    </soapenv:Body>
</soapenv:Envelope>
于 2019-03-22T18:43:37.643 回答
1

我会同意 Das 所说的,我不相信肥皂请求的格式很重要。我的请求看起来与 Das 的相似或相同。

当我将您的与我之前发送的一个进行比较时,我看到以下内容:

  • 您正在使用ds前缀(在Signature元素中定义),我和 Das 没有;
  • Das 和我都在元素中使用了一个xmlns:oasi命名空间,而Envelope你的元素中省略了它。
  • 某些属性的格式/顺序不同,但我认为这实际上不是问题。

我似乎记得ds最初尝试在我的传输中使用前缀,但传输不起作用。但是,我不记得这是否仅针对状态传输,或者它是否也发生在提交中。

Signature我没有明确定义元素的命名空间前缀,而是使用xmlns="http://www.w3.org/2000/09/xmldsig#"它——你有这个作为xmlns:ds.

于 2019-03-22T20:40:57.113 回答