首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >适用于BulkRequestTransmissionStatus A2A IRS的TPE1105

适用于BulkRequestTransmissionStatus A2A IRS的TPE1105
EN

Stack Overflow用户
提问于 2019-03-21 05:38:56
回答 2查看 119关注 0票数 0

现在,我终于能够分别通过批量传输服务的1105和1122,我又回到了状态请求的1105。我已经重用了用于签名和生成http请求的代码,所以应该不会有太多问题。下面是我发送的经过格式化和值编辑的数据包。

代码语言:javascript
复制
            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,您将知道传输服务的两个给定示例显示了两种不同的变体,其中一种来自前一年。状态请求只有一个示例,而且是去年的。我确信我的其他必要值是正确的,UserId字段和唯一的传输Id,尽管在这里进行了编辑。感谢您在这里提供的任何帮助。

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

EN

回答 2

Stack Overflow用户

发布于 2019-03-23 02:43:38

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

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

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

代码语言:javascript
复制
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>
票数 2
EN

Stack Overflow用户

发布于 2019-03-23 04:40:57

我同意Das的说法,我不认为soap请求的格式很重要。我的请求看起来与Das相似或相同。

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

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

我似乎记得最初试图在我的传输中使用ds前缀,但传输无法工作。然而,我不记得这是否只发生在状态传输中,或者是否也出现在提交中。

我没有显式地定义Signature元素的名称空间前缀,而是使用了xmlns="http://www.w3.org/2000/09/xmldsig#" --您可以将其设置为xmlns:ds

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55270586

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档