GZIP compresses a request to a remote web service through WCF

I am writing an application using Visual Studio 2010 that needs to communicate with a remote web service. Since the amount of data transferred is potentially large (up to 100 MB), the service documentation says that the request message should be sent using GZIP HTTP compression.

My question is how to do this, given that I am just calling the method on the proxy object generated by Visual Studio and not executing the POST itself? In other words, since there is no “request” in my gzip code, how can I tell WCF to do this for me?

I connected to the service, adding a service link to my application using the provided WSDL, and then calling the generated Visual Studio proxy method to send the request. An exception is thrown with the message "Request message must be sent using HTTP compression." (Of course, this is not unexpected.)

enter image description here

Is there an attribute in web.config settings that defines a WCF service that will call WCF to request a GZIP before sending it to a remote host?

Note. I spent considerable time searching the Internet about this, but the problem is that most posts suggest that this requires compression of the web service response . In my case, however, this is a request sent from my client.

+1
2

, , , " ".

-, , : - - , .

, , XDocument ( XmlDocument), , SOAP XML, () - XML SOAP XML.

HttpWebRequest . . , .

HttpWebRequest : HttpWebRequest gzip

, -; , , .), , .) , , , .

- , , , .

+1

<binaryMessageEncoding /> <customBinding />? , , FaultException. SO . , , WebRequest , , , WSDL, .

WCF ( )

WCF ( )

, - .

Edit
, , - , -, .

# webservice Visual Studio 2010

# 2
, GZip. , : -.

, ( , HTTP-). , .

HTTP- (RFC 1952 - GZIP).

0

Source: https://habr.com/ru/post/1626647/


All Articles