IRS-A2A BulkRequestTransmitter - [TPE1207]请求消息缺少附件

时间:2016-04-23 05:36:08

标签: wcf irs

我正在尝试使用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>

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

1 个答案:

答案 0 :(得分: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#家伙(我是个老兄),所以这个帖子可以帮助你:IRS-A2A BulkRequestTransmitter message not formmatted properly and/or cannot be interpreted

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