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 8490033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:59:35+00:00 2026-06-10T21:59:35+00:00

I generate proxy classes with wsdl.exe to request web-services, that are probably build at

  • 0

I generate proxy classes with wsdl.exe to request web-services, that are probably build at java platform. The problem is with encoding of response. I get ‘?’ instead of russian letters.(for example ‘????26’ instead of ‘АН26’)
I also use soapUI and everything works well there. I am not experienced at configuring .Net clients. So how I could determine and configure proper encoding for response. I already played with app.config as next:

I attach headers information here. I don’t wee encoding info at responce headers…
request headers:

Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "urn:#DCSSci_ListFlight_5"
Content-Length: 641
Host: 109.73.1.66:23022
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

response headers:

HTTP/1.1 200 OK
Date: Thu, 06 Sep 2012 03:47:52 GMT
Server: Apache/2.2.10 (Linux/SUSE)
200 OKX-FidelXML-Version: 2.0
Content-length: 15464
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/xml

Solution:

public class TraceExtension : SoapExtension
{
    Stream oldStream;
    Stream newStream;
    public override Stream ChainStream(Stream stream)
    {
        oldStream = stream;
        newStream = new MemoryStream();
        return newStream;
    }
    public override object GetInitializer(LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute)
    {
        return null;
    }
    public override object GetInitializer(Type WebServiceType)
    {
        return null;
    }
    public override void Initialize(object initializer)
    {
    }
    public override void ProcessMessage(SoapMessage message)
    {
        switch (message.Stage)
        {
            case SoapMessageStage.BeforeSerialize:
                break;
            case SoapMessageStage.AfterSerialize:
                newStream.Position = 0;
                Copy(newStream, oldStream);
                break;
            case SoapMessageStage.BeforeDeserialize:
                message.ContentType = "application/soap+xml; utf-8";
                Copy(oldStream, newStream);
                newStream.Position = 0;
                break;
            case SoapMessageStage.AfterDeserialize:
                break;
        }
    }
    void Copy(Stream from, Stream to)
    {
        TextReader reader = new StreamReader(from, System.Text.Encoding.GetEncoding("utf-8"));
        TextWriter writer = new StreamWriter(to, System.Text.Encoding.GetEncoding("utf-8"));
        writer.WriteLine(reader.ReadToEnd());
        writer.Flush();
    }
}

[AttributeUsage(AttributeTargets.Method)]
public class TraceExtensionAttribute : SoapExtensionAttribute
{
    private int priority;
    public override Type ExtensionType
    {
        get { return typeof(TraceExtension); }
    }
    public override int Priority
    {
        get { return priority; }
        set { priority = value; }
    }
}

And than just add

[TraceExtension()] 
attribute for proxy invoke method
  • 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-06-10T21:59:37+00:00Added an answer on June 10, 2026 at 9:59 pm

    You can override GetWebResponse of your proxy and change the encoding

    public class YourProxyClass : SoapHttpClientProtocol
    {
        protected override WebResponse GetWebResponse(WebRequest request)
        {
            var response = base.GetWebResponse(request);
            response.Headers["Content-Type"] = "text/xml; charset=utf-8"; //<==
            return response;
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

wsdl.exe , appears to be the default tool for .Net to generate proxy class
I'm talking with a web service with a generated proxy that uses System.Web.Services.Protocols.SoapHttpClientProtocol ,
I was trying to use svcutil.exe to generate proxy classes for a service but
I found that the proxy generated with SlSvcUtil.exe (or by adding reference to Web
I am trying to use jax-ws to generate web service proxy classes, using the
I'm trying to generate a proxy class from a local WSDL file with eclipse
I'm building a contract-first SOAP client. When I try to generate the proxy classes
I'm generating a WCF Proxy to my contract. The contract contain classes that are
I've created proxy classes using svcutil with a given "SAP CRM" WSDL file. It
Is it possible to get WSDL.exe to generate interfaces as well as, or instead

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.