2016-04-23 54 views
0

我想要發送使用WCF和文件的請求到IRS附着如下IRS-A2A BulkRequestTransmitter - [TPE1207該請求消息丟失的附件

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); 

當我看請求I可以看到在SOAP體

<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> 

二進制數據我失去了什麼?是否有任何特定的綁定或編碼需要添加?

+0

您遇到的實際問題是什麼?此外,您發佈的代碼片段有所欠缺。 – khlr

+0

我收到來自IRS的故障錯誤消息,錯誤代碼爲TPE1207(請求消息缺少附件)。 – Ravi

+0

@khlr我編輯了這個片段。 – Ravi

回答

1

如果我正確地讀取了您生成的XML,您似乎已將元素中的稅務表單的文件內容嵌入到該元素中。也許這是因爲當你查看IRS分發的wsdl文件時,所述元素被描述爲xsd:base64Binary

如果你看一下84頁國稅局組成指南V4.3的,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 message not formmatted properly and/or cannot be interpreted

我遇到了麻煩,我們的1095個數據發送到國稅局,直到我看到第84頁中構圖指南。人們會認爲符合WSDL應該足以與Web服務進行通信;)