【问题标题】:IRS ACA 1095C SOAP Fault : Error in assertion processingIRS ACA 1095C SOAP 错误:断言处理错误
【发布时间】:2020-02-25 05:41:48
【问题描述】:

我在向 IRS ACA 网站提交 1094/1095C 时随机出现错误。它一直是一个有效的代码,因为我没有对代码进行任何更改突然之间我开始看到这个错误,很少提交。

代码在java中。我们仍然能够成功完成完整提交,但某些提交返回 SOAP 错误错误。


........
 org.apache.cxf.endpoint.Client yclient = (org.apache.cxf.endpoint.Client) factory.create();
            GZIPInInterceptor ininterceptor = new GZIPInInterceptor();
            yclient.getInInterceptors().add(ininterceptor);
            Endpoint eEndpoint = yclient.getEndpoint();
            EndpointInfo einfo = eEndpoint.getEndpointInfo();
            BindingInfo b = einfo.getBinding();
            ProviderFactory pf = ServerProviderFactory.getInstance();
            eEndpoint.put(ProviderFactory.class.getName(), pf);

            yclient.getRequestContext().put("soap.env.ns.map", nsMap);
            yclient.getRequestContext().put("org.apache.cxf.client", Boolean.FALSE);
            Collection<BindingOperationInfo> c = b.getOperations();
            Iterator<BindingOperationInfo> it = c.iterator();
            while (it.hasNext()) {
                BindingOperationInfo bi = it.next();
                QName name = bi.getOperationInfo().getName();

                System.out.println(name.toString());
                GZIPOutInterceptor interceptor = new GZIPOutInterceptor();
                interceptor.setForce(true);
                yclient.getOutInterceptors().add(interceptor);

                Map<String, Object> ycontext = yclient.getRequestContext();
                ycontext.put(MessageContext.HTTP_REQUEST_HEADERS, head);
                Map<Integer, Class<?>> wssConfigActions = new HashMap<Integer, Class<?>>();
                Map<String, Object> serverOutParams = createServerOutParams(wssConfigActions, true);

                yclient.getOutInterceptors().add(new SOAPSecurityInterceptor());
                yclient.getOutInterceptors().add(new SecurityHeaderHandler(null));
                AIRXMLSignInterceptor sigInterceptor = new AIRXMLSignInterceptor(serverOutParams, true);
                sigInterceptor.privateKey = PrivateKey;
                yclient.getOutInterceptors().add(sigInterceptor);
                AddressingProperties maps = new AddressingProperties();
                AttributedURIType iri = new AttributedURIType();
                iri.setValue("RequestSubmissionStatusDetail");
                maps.setAction(iri);

                ACABulkRequestTransmitterStatusDetailRequestType statusRequest = new ACABulkRequestTransmitterStatusDetailRequestType();
                statusRequest.setId("id-00E7E0006E615C14D6000736030986000");
                statusRequest.setVersion("1.0");

                ACABulkReqTrnsmtStsReqGrpDtlType reqDetail = new ACABulkReqTrnsmtStsReqGrpDtlType();
                reqDetail.setReceiptId(submissionRecord.StatusInfo.ReceiptId);
                statusRequest.setACABulkReqTrnsmtStsReqGrpDtl(reqDetail);
                ACABulkBusinessHeaderRequestType businessHeader = new ACABulkBusinessHeaderRequestType();
                businessHeader.setId("id-00E7E0006E615C14D6000736030986000");
                businessHeader.setUniqueTransmissionId(submissionRecord.StatusInfo.UniqueTransmissionId);

                GregorianCalendar gregory = new GregorianCalendar();
                TimeZone utc = TimeZone.getTimeZone("UTC");
                gregory.setTime(UTCDate.now());
                gregory.setTimeZone(utc);
                XMLGregorianCalendar calendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregory);
                BusinessHeaderTimeStamp bhts = new BusinessHeaderTimeStamp(calendar);
                businessHeader.setTimestamp(bhts);

                System.out.println(bhts.toXMLFormat());

                javax.xml.ws.Holder<ACABulkBusinessHeaderRequestType> businessHeaderWrapper = new javax.xml.ws.Holder<ACABulkBusinessHeaderRequestType>();
                businessHeaderWrapper.value = businessHeader;
                SecurityHeaderType securityHeader = configureSecurityHeader(now);

                System.out.println("Polling receiptId: " + submissionRecord.StatusInfo.ReceiptId);
                TransmitterACASecurityHeaderType acaSecurityHeader = new TransmitterACASecurityHeaderType();
                acaSecurityHeader.setUserId(ASID);

                Object[] res1 = yclient.invoke(bi, statusRequest, acaSecurityHeader, securityHeader,
                        businessHeaderWrapper);

                ACABulkRequestTransmitterStatusDetailResponseType response = (ACABulkRequestTransmitterStatusDetailResponseType) res1[0];
                submissionRecord.StatusInfo.Response = response;

                String xml = submissionRecord.StatusInfo.toXML();
                return xml;

......

最终请求:

<soapenv:Envelope xmlns:irs="urn:us:gov:treasury:irs:common" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:us:gov:treasury:irs:ext:aca:air:ty18" xmlns:urn2="urn:us:gov:treasury:irs:msg:acabusinessheader" xmlns:urn3="urn:us:gov:treasury:irs:srv:irsacabulkrequesttransmitter"
 xmlns:urn4="urn:us:gov:treasury:irs:msg:acasecurityheader" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
        <wsse:Security 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-0000E45A7D26C7FA400002296060180000">
                <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-0000E45A7D26C7FA471572296060100000">
                        <ds:Transforms>
                            <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                                <InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsse wsa irs soapenv urn urn2 urn3 urn4 wsse"/>
                            </ds:Transform>
                        </ds:Transforms>
                        <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                        <ds:DigestValue>2+tTV2cozq0boqXSgb+K6FY2EqjM5fCvBMiwbBR97sE=</ds:DigestValue>
                    </ds:Reference>
                    <ds:Reference URI="#id-081a1c66-00d0-45cd-9d00-bf8c4eddf19e">
                        <ds:Transforms>
                            <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                                <InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsa irs soapenv urn2 urn3 urn4 wsse"/>
                            </ds:Transform>
                        </ds:Transforms>
                        <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                        <ds:DigestValue>ENBnod7vKlXCLiWqft1H4duETdaR4MxotsJ8JVUhZDc=</ds:DigestValue>
                    </ds:Reference>
                    <ds:Reference URI="#id-E68EBBF1696C5DD4AA143353323390578">
                        <ds:Transforms>
                            <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                                <InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsa irs soapenv urn urn3 urn4 wsse"/>
                            </ds:Transform>
                        </ds:Transforms>
                        <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                        <ds:DigestValue>0gJBTeYumHhBgwSM08x0lAQeiFb9xGlsacSe7E5GzeQ=</ds:DigestValue>
                    </ds:Reference>
                </ds:SignedInfo>
                <ds:SignatureValue>eXaUaEVZMzg1Bxsy+EVoIG4d4to3lrUW+7==</ds:SignatureValue>
                <ds:KeyInfo Id="KI-1057E45A7D26C7FA471572296060184463">
                    <wsse:SecurityTokenReference wsu:Id="STR-1057E45A7D26C7FA471572296060184464">
                        <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">MIIGNTCCBR2gAwIBAgIQQAF...VIrQSgw</wsse:KeyIdentifier>
                    </wsse:SecurityTokenReference>
                </ds:KeyInfo>
            </ds:Signature>
            <wsu:Timestamp wsu:Id="TS-1057E45A7D26C7FA471572296060184461">
                <wsu:Created>2019-10-28T20:54:20.184Z</wsu:Created>
                <wsu:Expires>2019-10-28T21:04:20.184Z</wsu:Expires>
            </wsu:Timestamp>
        </wsse:Security>

        <Action xmlns="http://www.w3.org/2005/08/addressing">BulkRequestTransmitter</Action>
        <MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:d0711332-e90f-4587-848b-3ee0da27c2e9</MessageID>
        <To xmlns="http://www.w3.org/2005/08/addressing">https://la.www4.irs.gov/airp/aca/a2a/1095BC_Transmission</To>
        <ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
            <Address>http://www.w3.org/2005/08/addressing/anonymous</Address>
        </ReplyTo>
        <urn4:ACASecurityHeader xmlns:ns6="http://www.w3.org/2000/09/xmldsig#" xmlns:ns7="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ns8="urn:us:gov:treasury:irs:msg:irsacabulkrequesttransmitter">
            <irs:UserId>0aB0000</irs:UserId>
        </urn4:ACASecurityHeader>
        <urn2:ACABusinessHeader xmlns:ns6="http://www.w3.org/2000/09/xmldsig#" xmlns:ns7="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ns8="urn:us:gov:treasury:irs:msg:irsacabulkrequesttransmitter" ns7:Id="id-E00EBBF0000C5DD4AA143353323390000">
            <urn:UniqueTransmissionId>65fc42c9-8ecd-46f2-0000-00000d58b9be:SYS12:BB01F::T</urn:UniqueTransmissionId>
            <irs:Timestamp>2019-10-28T20:54:20Z</irs:Timestamp>
        </urn2:ACABusinessHeader>
        <urn:ACATransmitterManifestReqDtl xmlns:ns6="http://www.w3.org/2000/09/xmldsig#" xmlns:ns7="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ns8="urn:us:gov:treasury:irs:msg:irsacabulkrequesttransmitter" ns7:Id="id-00000c66-00d0-45cd-9d00-bf8c4eddf19e">
            <urn:PaymentYr>2016</urn:PaymentYr>
            <urn:PriorYearDataInd>1</urn:PriorYearDataInd>
            <irs:EIN>000000000</irs:EIN>
            <urn:TransmissionTypeCd>O</urn:TransmissionTypeCd>
            <urn:TestFileCd>P</urn:TestFileCd>
            <urn:TransmitterNameGrp>
                <urn:BusinessNameLine1Txt>First Capitol Consulting</urn:BusinessNameLine1Txt>
            </urn:TransmitterNameGrp>
            <urn:CompanyInformationGrp>
                <urn:CompanyNm>F  Co</urn:CompanyNm>
                <urn:MailingAddressGrp>
                    <urn:USAddressGrp>
                        <urn:AddressLine1Txt>Abc Blvd</urn:AddressLine1Txt>
                        <urn:AddressLine2Txt>Suite 000</urn:AddressLine2Txt>
                        <irs:CityNm>L city</irs:CityNm>
                        <urn:USStateCd>aA</urn:USStateCd>
                        <irs:USZIPCd>00000</irs:USZIPCd>
                    </urn:USAddressGrp>
                </urn:MailingAddressGrp>
                <urn:ContactNameGrp>
                    <urn:PersonFirstNm>a</urn:PersonFirstNm>
                    <urn:PersonLastNm>b</urn:PersonLastNm>
                </urn:ContactNameGrp>
                <urn:ContactPhoneNum>0000000000</urn:ContactPhoneNum>
            </urn:CompanyInformationGrp>
            <urn:VendorInformationGrp>
                <urn:VendorCd>I</urn:VendorCd>
                <urn:ContactNameGrp>
                    <urn:PersonFirstNm>f</urn:PersonFirstNm>
                    <urn:PersonLastNm>a</urn:PersonLastNm>
                </urn:ContactNameGrp>
                <urn:ContactPhoneNum>0000000000</urn:ContactPhoneNum>
            </urn:VendorInformationGrp>
            <urn:TotalPayeeRecordCnt>180</urn:TotalPayeeRecordCnt>
            <urn:TotalPayerRecordCnt>1</urn:TotalPayerRecordCnt>
            <urn:SoftwareId>00A0000000</urn:SoftwareId>
            <urn:FormTypeCd>1094/1095C</urn:FormTypeCd>
            <irs:BinaryFormatCd>application/xml</irs:BinaryFormatCd>
            <irs:ChecksumAugmentationNum>dc4206d79d71cc9c8d5e9183677580e0b68b2a708543409aaec7a407c66d6a0e</irs:ChecksumAugmentationNum>
            <irs:AttachmentByteSizeNum>336472</irs:AttachmentByteSizeNum>
            <urn:DocumentSystemFileNm>1094C_Request_BB01F_20191028T205416001Z.xml</urn:DocumentSystemFileNm>
        </urn:ACATransmitterManifestReqDtl>
    </soapenv:Header>

    <soapenv:Body>
        <ns8:ACABulkRequestTransmitter xmlns:ns6="http://www.w3.org/2000/09/xmldsig#" xmlns:ns7="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ns8="urn:us:gov:treasury:irs:msg:irsacabulkrequesttransmitter" version="1.0">
            <irs:BulkExchangeFile>
                <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:734ca002-8275-4680-a24c-923694dc777e-93@urn%3Aus%3Agov%3Atreasury%3Airs%3Acommon"/>
            </irs:BulkExchangeFile>
        </ns8:ACABulkRequestTransmitter>
    </soapenv:Body>
</soapenv:Envelope>
--uuid:c82296c0-0eaf-4133-971d-7838bafae222

我收到以下错误 (500)

ID:98 响应码:500
编码:UTF-8
内容类型:text/xml;charset=utf-8
标题:{connection=[close], Content-Length=[613], content-type=[text/xml;charset=utf-8], Date=[Mon, 28 Oct 2019 20:54:36 GMT], Set -Cookie=[dc=dcd;Path=/;Version=1;Secure;Httponly;Max-Age=900], Strict-Transport-Security=[max-age=31536000], X-Cnection=[close]}

有效载荷:

<soapenv:Fault>

  <faultcode>soapenv:Server</faultcode>

  <faultstring>Error in assertion processing</faultstring>

  <faultactor>ssg</faultactor>

  <detail>

    <l7:policyResult xmlns:l7="http://www.layer7tech.com/ws/policy/fault" status="Multipart stream ended before a terminating boundary was encountered"/>

  </detail>

</soapenv:Fault>

谁能解释一下我错过了什么或做错了什么。

【问题讨论】:

  • 尝试修改你的CXF配置;我们添加了 AllowChunking="false" 和 secureSocketProtocol="TLSv1.2" 以使其再次工作。 AllowChunking="false"/>

标签: java soap mtom irs


【解决方案1】:

感谢 Tim Schumacher,我能够使用此解决方案,对我的自定义 ssl 套接字工厂进行了更改

    HTTPConduit http = (HTTPConduit) client.getConduit();
    TLSClientParameters tlsParms = new TLSClientParameters();
    tlsParms.setSSLSocketFactory(sslContext.getSocketFactory());
    tlsParms.setSecureSocketProtocol("TLSv1.2");
    http.setTlsClientParameters(tlsParms);
    HTTPClientPolicy policy = new HTTPClientPolicy();
    policy.setAllowChunking(false);
    http.setClient(policy);

【讨论】:

    【解决方案2】:

    通过修改我们的配置,我们能够使用 Apache CXF v3.1.4 来实现这一点;我们添加了 AllowChunking="false" 和 secureSocketProtocol="TLSv1.2"。在此更改之前,我们还收到了自 2019 年 10 月开始以来对于任何大于约 60 KB 的传输的响应“断言处理中的错误”。以下是我们对 Apache CXF XML 配置所做的更改:

      <http-conf:conduit name="*.http-conduit">
                          AllowChunking="false"
        />
        <http-conf:tlsClientParameters
                secureSocketProtocol="TLSv1.2"
        />
    </http-conf:conduit>
    

    【讨论】:

      【解决方案3】:

      我也遇到过同样的问题,但我们确实找到了手动解决这些问题的方法。我想分享一下,以防它帮助你弄清楚发生了什么,尽管我认为 IRS 需要做出改变。

      有 3 个问题需要处理。

      1. 在标题中有创建和过期的时间戳,我们必须在上面添加毫秒。

      2. 上面提到了一些我们必须从传输中删除 Transfer-Encoding: chunked(我们在 Fiddler 中手动完成的)。

      3. 我不得不自己 gzip 整个邮件。该程序对消息进行了 gzip,但是当我查看代码中的压缩消息和发送的最终消息时,开头添加了 8 个字符,最后的部分内容发生了更改。如果我把身体和 gzip 它自己和过去回到提琴手(删除分块)然后我得到一个成功的响应。

      【讨论】:

      • 应该提到我的程序是c#所以这个问题不限于java。
      【解决方案4】:

      我已经为此工作了一段时间,并消除了邮箱建议的前 2 件事(TLS 1.2、FIPS 和我这边的网络问题)。我怀疑他们将中间层更改/更新为 Broadcom(以前的 Layer7 和 CA)。我将通过关闭 http 分块编码来进行测试,因为我默认启用它。如果您不确定如何关闭它,您可以使用 http 1.0,因为它仅在 http 1.1 中受支持。我更新以关闭 http 协议(WebSphere 中的策略)上的分块编码,我能够从发送 35 到 3000 甚至更高。

      【讨论】:

      • 嗨@nicholasglen 谢谢。在我看来,内容传输编码设置为“二进制”。我仍然收到错误消息。
      • Address: https://la.www4.irs.gov/airp/aca/a2a/1095BC_Transmission Encoding: UTF-8 Http-Method: POST Content-Type: multipart/related; type="application/xop+xml"; boundary="uuid:cc"; start="&lt;root.message@cxf.apache.org&gt;"; start-info="text/xml" Headers: {Accept=[*/*], Accept-Encoding=[gzip,gzip;q=1.0, identity; q=0.5, *;q=0, deflate], Content-Encoding=[gzip], SOAPAction=["BulkRequestTransmitter"]} Messages: (message truncated to 49152 bytes) Payload: --uuid:cc Content-Type: application/xop+xml; charset=UTF-8; type="text/xml" Content-Transfer-Encoding: binary
      • 如何关闭 http 分块编码?我们正在使用 org.apache.cxf。
      • 美国国税局已回复以下消息:“遇到此问题的发射机应尝试在终端禁用多部分流式传输的情况下进行传输”。如何禁用多部分流式传输?我们使用包 org.apache.cxf.jaxws。
      • 我可以看到我们正在使用您在 http 应用程序策略集上设置的 WebSphere。您可以尝试的一种解决方案是从不支持分块的 http 1.1 更改为 1.0。不要认为内容编码与分块传输相同。分块传输在 http 协议级别进行管理,只是将大块分成小块。希望 IRS 在我将调查结果发送给他们时打开分块。 en.wikipedia.org/wiki/Chunked_transfer_encoding
      【解决方案5】:

      我确实遇到了同样的问题。我在您的代码或 SOAP 信封中没有看到任何问题,所以我唯一的建议是写信给 IRS AIR 邮箱,他们会进行调查。这就是他们现在对我的案子所做的。

      【讨论】:

      • 好的,谢谢@Maksim。我会写信给 IRS AIR 邮箱。如果您碰巧收到他们的回复,请在此处发布更新。我也会这样做。
      • 美国国税局已回复以下消息:“遇到此问题的发射机应尝试在终端禁用多部分流式传输的情况下进行传输”。 @Maksim 关于如何禁用多部分流的任何指示。
      • 嗨@scrounger。我使用 JaxWsClientProxy 客户端,但不确定是否可以在不调整内部属性的情况下禁用多部分流。你有什么成功吗?
      • 我们正在使用 JaxWsProxyFactoryBean 客户端。我还没有弄清楚我需要调整哪些属性才能禁用多部分流。
      猜你喜欢
      • 2016-06-21
      • 1970-01-01
      • 2016-09-16
      • 1970-01-01
      • 2016-04-13
      • 1970-01-01
      • 2014-01-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多