Special Characters WebService C # SQL X Firebird Base

0

I have an integration made by Web-service (asmx) , C# e SQL Server . This Web-Service is consumed by third-party software that uses Delphi and Firebird.

The problem is that by integrating a string field that has special characters, questions (?) are appearing in place of the characters.

  

For example, the Delphi program sends a client registry with the name   John, when it arrives in the web-service is Jo ?? o.

Is there anything I can do in web-service to avoid this problem? or should the treatment be done on the client side? And what should be done?

I tried to include a globalization to solve the situation, it did not work:

<globalization
 requestEncoding="iso-8859-1"
 responseEncoding="iso-8859-1"
 responseHeaderEncoding="iso-8859-1"
 fileEncoding="iso-8859-1"
 resourceProviderFactoryType=""
 enableBestFitResponseEncoding="true"/>

WebMethod example:

[WebMethod]
    public MessageRet IntegrarItemInsumo(ItemInsumo Object)
    {
        try
        {
            return Object.Add();
        }
        catch (Exception)
        {

            throw;
        }
    }
    
asked by anonymous 05.07.2016 / 15:06

1 answer

0

Brian, I believe that the Delphi client that consumes your WebService is sending the incorrect ContentType , in which case you can contact your client and ask them to use text/xml; charset=iso-8859-1 .

Or you can arranjo técnico provisório and modify ContentType of all requests in your Global.asax :

protected void Application_BeginRequest(object sender, EventArgs e)
{
    HttpContext.Current.Request.ContentType = "text/xml; charset=iso-8859-1";
}

If it also does not work with iso-8859-1 , try UTF-8

    
05.07.2016 / 17:14