Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3231694
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:04:30+00:00 2026-05-17T17:04:30+00:00

We are receiving a message from a WCF call as GZip data, but the

  • 0

We are receiving a message from a WCF call as GZip data, but the code is expecting XML.

I am working on a PDA that communicates with a WCF web service. The response from the service is SOAP format compressed using gzip.

Because we’re working in CF3.5 we’re having to generate the service client proxy using the NetCFSvcUtil.exe utility program.

This is the part of the generated code in CFClientBase where the error is raised.

Private Function getReply(ByVal msg As System.ServiceModel.Channels.Message) As System.ServiceModel.Channels.Message
    If (Me.RequestChannelFactory Is Nothing) Then
        'transport doesn't support requests
        Throw New System.NotSupportedException
    End If
    Dim requestChannel As System.ServiceModel.Channels.IRequestChannel
    System.Threading.Monitor.Enter(Me.RequestChannelFactory)
    Try 
        requestChannel = Me.RequestChannelFactory.CreateChannel(Me.remoteAddress)
    Finally
        System.Threading.Monitor.Exit(Me.RequestChannelFactory)
    End Try
    requestChannel.Open
    Try 
        Return requestChannel.Request(msg)  
    Finally
        If (requestChannel.State = System.ServiceModel.CommunicationState.Opened) Then
            requestChannel.Close
        End If
    End Try
End Function

On the line requestChannel.Request(msg) the response is gzipped, but it throws an exception because it is expecting xml.

It’s falling over with the message: “There is a problem with the XML that was received from the network. See inner exception for more details.”
Inner Exception: “”, hexadecimal value 0x1F, is an invalid character. Line 1, position 1.”

I’ve run out of ideas on this, any help/advice would be very welcome.

UPDATE:
I gave up trying to do it this way – ran out of time.
In the end I changed my bindings to basicHTTPBinding, added a web reference via Visual Studio, then did it the way GôTô suggested. Trying to do anything beyond the most basic things between WCF and compact framework is such a pain.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:04:31+00:00Added an answer on May 17, 2026 at 5:04 pm

    Have you tried this solution:

    On the client side, you can hook on
    the
    DataServiceContext.SendingRequest
    event to enable AutoDecompress on the
    request

    ((System.Net.HttpWebRequest)e.Request).AutomaticDecompression
    = (System.Net.DecompressionMethods.GZip
    |
    System.Net.DecompressionMethods.Deflate);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a project right now that involves receiving a message from
I'm working with C and through a socket I will be receiving a message
I'm receiving feedback from a developer that The only way visual basic (6) can
I'm making a call to a WCF service but I get a CommunicationException on
We have a production system that gathers telemetry data from remote devices. This data
When receiving a bug report or an it-doesnt-work message one of my initials questions
I am receiving dynamic xml where I won't know the attribute names, if you'll
When sending messages from a self hosted WCF service to many clients (about 10
I am attempting to retrieve a list of objects from Entity Framework via WCF,
here's the setup for the project. I have a WCF Service that is hosted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.