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=\"Web\" /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>