TPE 1105适用于BulkRequestTransmissionStatus A2A IRS

时间:2019-03-20 21:38:56

标签: java xml http soap irs

现在,我终于能够分别通过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字段和Unique Transmission Id,尽管此处已将其删除。感谢您的任何帮助。

编辑-我知道URL错误,这只是捕获SSL外部流量的内部端点。另外,我尝试使用8bit而不是二进制,因为这就是从我们的末端开始设置原始传输服务的方式。

2 个答案:

答案 0 :(得分: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>

答案 1 :(得分:1)

我将同意达斯所说的话,我不认为肥皂要求的格式很重要。我的要求与Das'相似或相同。

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

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

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

我没有明确定义Signature元素的名称空间前缀,而是使用xmlns="http://www.w3.org/2000/09/xmldsig#" -您将其作为xmlns:ds