0

I'm trying to send data to the IRS using a WSDL file and WCF. I'm using .NET and Microsoft VS.NET, which created a proxy class I'm utilizing to communicate.

My problem is I keep getting a message saying GZip compression is required from the IRS:

The request message must be sent using HTTP compression (RFC 1952 - GZIP). Please review the transmission instructions outlined in Section 5 of Publication 5258, AIR Submission Composition and Reference Guide, located at https://www.irs.gov/e-file-providers/air/affordable-care-act-information-return-air-program, correct any issues, and try again.'

The publication referred to in the error message is very generic and is not specific to .NET and WCF. I did some research and found a way to enable GZip compression in web.config:

<binaryMessageEncoding compressionFormat="GZip" />

However, I now get this error:

The content type text/xml;charset=utf-8 of the response message does not match the content type of the binding (application/soap+msbin1+gzip). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.

Does anyone know what I'm doing wrong? Do I need to create a custom encoder? Here's is my full web.config file:

<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.7.2"/>
    <httpRuntime targetFramework="4.7.2"/>
  </system.web>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>

  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="GetACATransmitterStatusReqBinding">
          <security mode="Transport" />
        </binding>
        <binding name="GetACATransmitterStatusReqBinding1" />
      </basicHttpBinding>
      <customBinding>
        <binding name="BulkRequestTransmitterBinding">
          <!--<textMessageEncoding messageVersion="Soap11WSAddressing10" />-->
            <binaryMessageEncoding compressionFormat="GZip" />
            
          <httpsTransport />
        </binding>
      </customBinding>
    </bindings>
    <client>
      <endpoint address="https://la.www4.irs.gov/airp/aca/a2a/1095BC_Transmission_AATS"
        binding="customBinding" bindingConfiguration="BulkRequestTransmitterBinding"
        contract="BulkRequestTransmitterService.BulkRequestTransmitterPortType"
        name="BulkRequestTransmitterPort" />
      <endpoint address="https://la.www4.irs.gov/airp/aca/a2a/1095BC_Status_Request_AATS"
        binding="basicHttpBinding" bindingConfiguration="GetACATransmitterStatusReqBinding"
        contract="ACAGetTransmitterBulkRequestStatus.ACATransmitterStatusReqPortType"
        name="ACATransmitterStatusReqPort" />
    </client>
  </system.serviceModel>
</configuration>
Andre
  • 13
  • 7
  • *I keep getting a message saying GZip compression is required from the IRS* What kind of a message? Compression required where? `` from what I remember means sending the actual SOAP message as binary instead of text. Most likely you need GZip at the HTTP level not the SOAP level, i.e. text SOAP message but a GZip request. – Bogdan May 27 '21 at 09:01
  • @Bogdan I updated the original post to include the message requiring GZip compression. Do you know of a way to use GZip at the HTTP level in web.config? – Andre May 27 '21 at 14:33
  • If your client is hosted on IIS then normally the configuration to compress requests could be done there, since the web server already handles that for HTML pages and other resources. If not, then a message encoder of some sort could be added to the WCF processing pipeline to compress the request before sending it. It's been a while since I've touched WCF so maybe see if this is of any help: https://stackoverflow.com/questions/4416177/how-to-compress-http-requests-from-wcf-net-at-the-transport-level – Bogdan May 28 '21 at 10:19

0 Answers0