1

我正在尝试使用 WCF 将请求发送到 IRS,并且文件附加如下

TransmitterACAUIBusinessHeaderType manifestType = iRSSubmissionManifest;

ACASendService.BulkRequestTransmitterRequest request = new ACASendService.BulkRequestTransmitterRequest();

request.Security = GetSecurity();
request.ACATransmitterManifestReqDtl = GetACATransmitterManifestReqDtl(manifestType);
request.ACABusinessHeader = GetACATransmitterBusinessHeaderRequest(manifestType);

request.ACABulkRequestTransmitter = new ACABulkRequestTransmitterType();
byte[] uploadFile = StreamingHelper.Chunk(_submissionXmlFolderPath);
request.ACABulkRequestTransmitter.BulkExchangeFile = uploadFile;

ACASendService.BulkRequestTransmitterPortTypeClient _airClient = new ACASendService.BulkRequestTransmitterPortTypeClient();
ACASendService.ACABulkRequestTransmitterResponseType response = _airClient.BulkRequestTransmitter(request.ACASecurityHeader, request.Security, ref request.ACABusinessHeader, request.ACATransmitterManifestReqDtl, request.ACABulkRequestTransmitter);

当我查看请求时,我可以在 Soap Body 中看到二进制数据

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:us:gov:treasury:irs:ext:aca:air:7.0" xmlns:urn1="urn:us:gov:treasury:irs:common" xmlns:urn2="urn:us:gov:treasury:irs:msg:acabusinessheader" xmlns:urn3="urn:us:gov:treasury:irs:msg:irsacabulkrequesttransmitter">
<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-57610A09584142FAA8ABFBD262776BF9" 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/2000/09/xmldsig#rsa-sha1"/>
                <Reference URI="#TS-C126221AACCA4F37BDBBC1AE27A45F44">
                    <Transforms>
                        <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                            <InclusiveNamespaces PrefixList="wsse wsa soapenv urn urn1 urn2 urn3" xmlns="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                        </Transform>
                    </Transforms>
                    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                    <DigestValue>DtSEqek9RuRdR/q8AlxobY/90+o=</DigestValue>
                </Reference>
                <Reference URI="#MF-D3C0AAF6624148A08627F799ECDDA387">
                    <Transforms>
                        <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                            <InclusiveNamespaces PrefixList="wsa soapenv urn1 urn2 urn3" xmlns="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                        </Transform>
                    </Transforms>
                    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                    <DigestValue>adRdmNY8Gwrebd9fMaiBRCgz/3o=</DigestValue>
                </Reference>
                <Reference URI="#BH-CD8C12D6D4984DD3901CFE1D9E65A86A">
                    <Transforms>
                        <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                            <InclusiveNamespaces PrefixList="wsa soapenv urn urn1 urn3" xmlns="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                        </Transform>
                    </Transforms>
                    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                    <DigestValue>dj4DhqNAJnNp40DT5dEdKGTOP48=</DigestValue>
                </Reference>
            </SignedInfo>
            <SignatureValue>Signature==</SignatureValue>
            <KeyInfo Id="KI-4174BEF920A14F639F7C4E9F825D53AE">
                <wsse:SecurityTokenReference wsu:Id="STR-192B01936AC24010A0DF60BD21F3A6FA">
                    <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" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">KeyData==</KeyIdentifier>
                </wsse:SecurityTokenReference>
            </KeyInfo>
        </Signature>
        <wsu:Timestamp wsu:Id="TS-C126221AACCA4F37BDBBC1AE27A45F44" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsu:Created>2016-04-18T12:03:46.570Z</wsu:Created>
            <wsu:Expires>2016-04-18T12:13:46.572Z</wsu:Expires>
        </wsu:Timestamp>
    </wsse:Security>
    <urn:ACATransmitterManifestReqDtl wsu:Id="MF-D3C0AAF6624148A08627F799ECDDA387" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <PaymentYr>2015</PaymentYr>
        <PriorYearDataInd>0</PriorYearDataInd>
        <EIN>EIN</EIN>
        <TransmissionTypeCd>O</TransmissionTypeCd>
        <TestFileCd>T</TestFileCd>
        <TransmitterNameGrp>
            <BusinessNameLine1Txt>Name</BusinessNameLine1Txt>
        </TransmitterNameGrp>
        <CompanyInformationGrp>
            <CompanyNm>Company</CompanyNm>
            <MailingAddressGrp>
                <USAddressGrp>
                    <AddressLine1Txt>Address1</AddressLine1Txt>
                    <CityNm>City</CityNm>
                    <USStateCd>MD</USStateCd>
                    <USZIPCd>ZIP</USZIPCd>
                </USAddressGrp>
            </MailingAddressGrp>
            <ContactNameGrp>
                <PersonFirstNm>First</PersonFirstNm>
                <PersonLastNm>Last</PersonLastNm>
            </ContactNameGrp>
            <ContactPhoneNum>Phone</ContactPhoneNum>
        </CompanyInformationGrp>
        <VendorInformationGrp>
            <VendorCd>I</VendorCd>
            <ContactNameGrp>
                <PersonFirstNm>First</PersonFirstNm>
                <PersonLastNm>Last</PersonLastNm>
            </ContactNameGrp>
            <ContactPhoneNum>Phone</ContactPhoneNum>
        </VendorInformationGrp>
        <TotalPayeeRecordCnt>1</TotalPayeeRecordCnt>
        <TotalPayerRecordCnt>1</TotalPayerRecordCnt>
        <SoftwareId></SoftwareId>
        <FormTypeCd>1094/1095C</FormTypeCd>
        <BinaryFormatCd>application/xml</BinaryFormatCd>
        <ChecksumAugmentationNum>4BDAA151D8543B25D9A3DCDFDBFF0F44</ChecksumAugmentationNum>
        <AttachmentByteSizeNum>3800</AttachmentByteSizeNum>
        <DocumentSystemFileNm>1094C_Request_TCC_20160418T062909155Z.xml</DocumentSystemFileNm>
    </urn:ACATransmitterManifestReqDtl>
    <urn2:ACABusinessHeader wsu:Id="BH-CD8C12D6D4984DD3901CFE1D9E65A86A" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <urn:UniqueTransmissionId xmlns:urn="urn:us:gov:treasury:irs:ext:aca:air:7.0">d5631c37-de39-4569-914f-41d482b780e6:SYS12:TCC::T</urn:UniqueTransmissionId>
        <urn1:Timestamp xmlns:urn1="urn:us:gov:treasury:irs:common">2016-04-18T17:33:53Z</urn1:Timestamp>
    </urn2:ACABusinessHeader>
    <wsa:Action>BulkRequestTransmitterService</wsa:Action>
</soapenv:Header>
<soapenv:Body>
    <urn3:ACABulkRequestTransmitter version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <urn1:BulkExchangeFile>PEZvcm0xMDk0OTVDVHJhbnNtaXR0YWxVcHN0cm_File_Bytes=</urn1:BulkExchangeFile>
    </urn3:ACABulkRequestTransmitter>
</soapenv:Body>

我错过了什么吗?是否需要添加任何特定的绑定或编码?

4

1 回答 1

1

如果我正确读取了您生成的 XML,则您似乎已将税表的文件内容嵌入到BulkExchangeFile元素中。这可能是因为当您查看 IRS 分发的 wsdl 文件时,所述元素被描述为xsd:base64Binary.

如果您查看 IRS 的作文指南 v4.3 第 84 页,https://www.irs.gov/PUP/for_taxpros/software_developers/information_returns/AIR%20Submission%20Composition%20and%20Reference%20Guide%20TY2015_v4.3_03_17_2016。 pdf(或在文档中搜索http://www.w3.org/2004/08/xop/include),您将看到BulkExchangeFile应该填充如下:

<inc:Include href="cid:yourAttachmentFile.xml" xmlns:inc="http://www.w3.org/2004/08/xop/include"/>

其中 yourAtachmentFile.xml 是您要发送到 IRS-AIR-A2A 系统的文件。正如您将在页面中看到的,您的税务数据预计将作为 MTOM 附件接收。

本质上,您上面的 XML 中包含税务数据,BulkExchangeElement并且您没有将数据作为 MTOM 附件发送。

我认为你是一个C#人(我是一个 java 伙计)所以这个线程可能会帮助你:IRS-A2A BulkRequestTransmitter 消息格式不正确和/或无法解释

在我看到《作文指南》的第 84 页之前,我无法将 1095 数据发送给 IRS。有人会认为遵守 WSDL 就足以与 Web 服务进行通信;)

于 2016-04-25T06:04:15.983 回答