SOAP error with Content-type

Hello,

With the followinf code I get the MESSAGE VIEW-AS error:

http error: 415
Message: Cannot process the message because the content type 'text/xml; charset="ISO-8859-1"' was not the expected type 'text/xml; charset=utf-8'.


Code:
USING OpenEdge.Core.*.
USING OpenEdge.Net.HTTP.*.
USING OpenEdge.Net.HTTP.IHttpClientLibrary.
USING OpenEdge.Net.HTTP.Lib.ClientLibraryBuilder.
USING OpenEdge.Net.URI.

DEFINE VARIABLE cDLC  AS CHARACTER NO-UNDO.
DEFINE VARIABLE oLib AS IHttpClientLibrary NO-UNDO.
DEFINE VARIABLE cSSLProtocols AS CHARACTER EXTENT 1  NO-UNDO.
DEFINE VARIABLE cSSLCiphers   AS CHARACTER EXTENT 1  NO-UNDO.
DEFINE VARIABLE oRequest                 AS IHttpRequest                 NO-UNDO.
DEFINE VARIABLE oResponse                AS IHttpResponse                NO-UNDO.
DEFINE VARIABLE oURI                     AS URI                          NO-UNDO.
DEFINE VARIABLE oRequestBody             AS OpenEdge.Core.String         NO-UNDO.
DEFINE VARIABLE hXMLHandle               AS HANDLE                       NO-UNDO.
DEFINE VARIABLE lcXML                    AS LONGCHAR                     NO-UNDO.

ASSIGN cSSLProtocols[1] = 'TLSv1.2' 
       cSSLCiphers[1] = 'ECDHE-RSA-AES256-GCM-SHA384'.

/* Web Service based on this public WS http://www.dneonline.com/calculator.asmx . It consumes the WebService executing the Add Operation. */

oRequestBody =  NEW OpenEdge.Core.String(
'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">' +
'   <soapenv:Header/>' +
'   <soapenv:Body>' +
'      <tem:Consulta>' +
'         <tem:expresionImpresa>' +
'<![CDATA[?re=CBE070913344&rr=CCO0309098N8&tt=28903.17&id=04C979D3-2D0F-45A1-AD80-E4625B7C5192]]>' +
'         </tem:expresionImpresa>' +
'      </tem:Consulta>' +
'   </soapenv:Body>' +
'</soapenv:Envelope>'
).

oLib = ClientLibraryBuilder:Build()
        :sslVerifyHost(NO)
        :SetSSLProtocols(cSSLProtocols)
        :SetSSLCiphers(cSSLCiphers)
        :Library.

oURI = URI:Parse("https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc").
oRequest = RequestBuilder:Post(oUri, oRequestBody)
                         :ContentType('text/xml;charset=UTF-8')
                         :AcceptAll()
                         :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                         :Request.

oResponse = ClientBuilder:Build()
                          :UsingLibrary(oLib)
                          :Client
                          :Execute(oRequest).

IF oResponse:StatusCode <> 200 THEN
   DO:
    MESSAGE "http error: " oResponse:StatusCode SKIP
             "Message: " oResponse:StatusReason VIEW-AS ALERT-BOX.
    RETURN ERROR "Request Error: " + STRING(oResponse:StatusCode).
   END.
ELSE
  DO:
    hXMLHandle = CAST(oResponse:Entity,WidgetHandle):Value.
    hXMLHandle:SAVE('LONGCHAR',lcXML).
    MESSAGE STRING(lcXML) VIEW-AS ALERT-BOX.
 END.

How can I change the Content type from ISO-8859-1 to UTF-8?
 
The code you have is the correct approach.

I would check to see what is actually being sent - if you set up the LOG-MANAGER with a LOGGING-LEVEL of 5 you will get a request-raw.txt file with the data that's sent to the server. You can see there whether the header value is correct.

It may be that there are bugs in the 11.6 HTTP client in this area - I don't recall.

You can also try something like
Code:
define variable oHeader as HttpHeader no-undo.

// do the request builder thing
oHeader = oRequest:GetHeader('content-type').

message oHeader:toString().

// See https://documentation.progress.com/output/oehttpclient/oe116/ for doc on the
// methods etc

// You can explicitly set the content type parameter
oHeader:SetParameterValue('charset', 'utf-8').

// send the request
 
Just to prove a theory. What happens if you set the content-type to be "application/soap+xml", or just "text/xml"? Omit the character set.
 
Just to prove a theory. What happens if you set the content-type to be "application/soap+xml", or just "text/xml"? Omit the character set.

With this:
Code:
oRequest = RequestBuilder:Post(oUri, oRequestBody)
/*                         :ContentType('text/xml; charset=utf-8')
*/
                        :ContentType('text/xml')
                        :AcceptAll()
                        :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                        :Request.
I get the same:
http error: 415
Message: Cannot process the message because the content type 'text/xml; charset="ISO-8859-1"' was not the expected type 'text/xml; charset=utf-8'.
 
The code you have is the correct approach.

I would check to see what is actually being sent - if you set up the LOG-MANAGER with a LOGGING-LEVEL of 5 you will get a request-raw.txt file with the data that's sent to the server. You can see there whether the header value is correct.

It may be that there are bugs in the 11.6 HTTP client in this area - I don't recall.

You can also try something like
Code:
define variable oHeader as HttpHeader no-undo.

// do the request builder thing
oHeader = oRequest:GetHeader('content-type').

message oHeader:toString().

// See https://documentation.progress.com/output/oehttpclient/oe116/ for doc on the
// methods etc

// You can explicitly set the content type parameter
oHeader:SetParameterValue('charset', 'utf-8').

// send the request

I did this but I get the same error,
Code:
oRequest = RequestBuilder:Post(oUri, oRequestBody)
                        :ContentType('text/xml; charset=utf-8')
                        :AcceptAll()
                        :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                        :Request.

oHeader = oRequest:GetHeader('content-type').
message "before:" oHeader:toString().
oHeader:SetParameterValue('charset', 'utf-8').
message "after:" oHeader:toString().
The messages shows:
before: Content-Type: text/xml; charset="utf-8"
after: Content-Type: text/xml; charset="utf-8"

So, it seems a OE11.6.3 bug,
 
Just to prove a theory. What happens if you set the content-type to be "application/soap+xml", or just "text/xml"? Omit the character set.
Interesting ....
I change to:
Code:
oRequest = RequestBuilder:Post(oUri, oRequestBody)
:ContentType('application/soap+xml; charset=utf-8')
                        :AcceptAll()
                        :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                        :Request.
And now the error is:
http error: 415
Message: Cannot process the message because the content type 'application/soap+xml; charset="utf-8"' was not the expected type 'text/xml; charset=utf-8'.

The charset ISO-8859-1 dissapear! ...
 
Interesting ....
I change to:
Code:
oRequest = RequestBuilder:Post(oUri, oRequestBody)
:ContentType('application/soap+xml; charset=utf-8')
                        :AcceptAll()
                        :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                        :Request.
And now the error is:
http error: 415
Message: Cannot process the message because the content type 'application/soap+xml; charset="utf-8"' was not the expected type 'text/xml; charset=utf-8'.

The charset ISO-8859-1 dissapear! ...

Ok, it looks like the server does not like the quoted charset value (even though that's legal HTTP).

You can try @Cecil 's suggestion to leave off the charset completely. That may work.

Getting rid of the quotes is more complicated ... the Http Client always quotes header parameter values. I'll have a think about how this can be done.
 
Ok, it looks like the server does not like the quoted charset value (even though that's legal HTTP).

You can try @Cecil 's suggestion to leave off the charset completely. That may work.

Getting rid of the quotes is more complicated ... the Http Client always quotes header parameter values. I'll have a think about how this can be done.
I think the issue is not the quote, it is the type "application/soap+xml;". Do you know how can I change it with an instruction similar to oHeader:SetParameterValue('charset', 'utf-8') ? I tried with oHeader:SetValue("text/xml") but do not compile.
 
I think the issue is not the quote, it is the type "application/soap+xml;". Do you know how can I change it with an instruction similar to oHeader:SetParameterValue('charset', 'utf-8') ? I tried with oHeader:SetValue("text/xml") but do not compile.

You were doing this earlier, and got the same error. Or? If so, that tells me that the server does not like the quoted charset.
Code:
oRequest = RequestBuilder:Post(oUri, oRequestBody)
                        :ContentType('text/xml; charset=utf-8')
                        :AcceptAll()
                        :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                        :Request.
 
I've tested on 11.7 and 12.8 and it works for me. Must be "feature" in 11.6.

C#:
/*------------------------------------------------------------------------
    File        : SOAPTEST.p
    Purpose     :

    Syntax      :

    Description :

    Author(s)   : james
    Created     : Tue Jun 11 13:47:07 NZST 2024
    Notes       :
  ----------------------------------------------------------------------*/

/* ***************************  Definitions  ************************** */

BLOCK-LEVEL ON ERROR UNDO, THROW.

/* ********************  Preprocessor Definitions  ******************** */


/* ***************************  Main Block  *************************** */
USING OpenEdge.Core.*.
USING OpenEdge.Net.HTTP.*.
USING OpenEdge.Net.HTTP.IHttpClientLibrary.
USING OpenEdge.Net.HTTP.Lib.ClientLibraryBuilder.
USING OpenEdge.Net.HTTP.IHttpResponse.
USING OpenEdge.Net.URI.

DEFINE VARIABLE cDLC           AS CHARACTER            NO-UNDO.
DEFINE VARIABLE oLib           AS IHttpClientLibrary   NO-UNDO.
DEFINE VARIABLE cSSLProtocols  AS CHARACTER            EXTENT 1 NO-UNDO.
DEFINE VARIABLE cSSLCiphers    AS CHARACTER            EXTENT 1 NO-UNDO.
DEFINE VARIABLE oRequest       AS IHttpRequest         NO-UNDO.
DEFINE VARIABLE oResponse      AS IHttpResponse        NO-UNDO.
DEFINE VARIABLE oURI           AS URI                  NO-UNDO.
DEFINE VARIABLE oRequestBody   AS OpenEdge.Core.String NO-UNDO.
DEFINE VARIABLE hXMLHandle     AS HANDLE               NO-UNDO.
DEFINE VARIABLE lcXML          AS LONGCHAR             NO-UNDO.
DEFINE VARIABLE ReponseXML     AS HANDLE               NO-UNDO.
DEFINE VARIABLE outputFileName AS CHARACTER            NO-UNDO.
DEFINE VARIABLE PlainTextObj   AS CLASS                OpenEdge.Core.String NO-UNDO.

ASSIGN
    cSSLProtocols[1] = 'TLSv1.2'
    cSSLCiphers[1]   = 'ECDHE-RSA-AES256-GCM-SHA384'.



/* Web Service based on this public WS http://www.dneonline.com/calculator.asmx . It consumes the WebService executing the Add Operation. */

oRequestBody =  NEW OpenEdge.Core.String(
    '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">' +
    '   <soapenv:Header/>' +
    '   <soapenv:Body>' +
    '      <tem:Consulta>' +
    '         <tem:expresionImpresa>' +
    '<![CDATA[?re=CBE070913344&rr=CCO0309098N8&tt=28903.17&id=04C979D3-2D0F-45A1-AD80-E4625B7C5192]]>' +
    '         </tem:expresionImpresa>' +
    '      </tem:Consulta>' +
    '   </soapenv:Body>' +
    '</soapenv:Envelope>'
    ).

oLib = ClientLibraryBuilder:Build()
        :sslVerifyHost(NO)
        :SetSSLProtocols(cSSLProtocols)
        :SetSSLCiphers(cSSLCiphers)
        :Library.

oURI = URI:Parse("https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc").
oRequest = RequestBuilder:Post(oUri, oRequestBody)
                         //:ContentType('text/xml; charset=UTF-8')
                         //:ContentType('text/xml')
                         :ContentType('text/xml; charset="UTF-8"')
                         :AcceptAll()
                         :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                         :Request.
                        
//oResponse = ClientBuilder:Build():UsingLibrary(oLib):ViaProxy(oURIProxy):Client:Execute(oRequest).   
oResponse = ClientBuilder:Build():UsingLibrary(oLib):Client:Execute(oRequest).

MESSAGE "oRequest:ContentType" oResponse:ContentType SKIP oResponse:StatusCode oResponse:StatusReason. 

ReponseXML     = CAST(oResponse:Entity,  OpenEdge.Core.WidgetHandle):value.
//PlainTextObj = CAST(oResponse:Entity, OpenEdge.Core.String  ).
                    
outputFileName = "xmloutput.xml" .

FILE-INFO:FILE-NAME = ".".
MESSAGE FILE-INFO:FULL-PATHNAME.

//COPY-LOB FROM OBJECT PlainTextObj:Value TO FILE outputFileName.                           

ReponseXML:SAVE('FILE', outputFileName).

Response:


XML:
<?xml version="1.0" encoding="UTF-8" ?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body>
<ConsultaResponse xmlns="http://tempuri.org/">
<ConsultaResult xmlns:a="http://schemas.datacontract.org/2004/07/Sat.Cfdi.Negocio.ConsultaCfdi.Servicio" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:CodigoEstatus>S - Comprobante obtenido satisfactoriamente.</a:CodigoEstatus>
<a:EsCancelable>Cancelable con aceptación</a:EsCancelable><a:Estado>Cancelado</a:Estado>
<a:EstatusCancelacion>Plazo vencido</a:EstatusCancelacion><a:ValidacionEFOS>200</a:ValidacionEFOS>
</ConsultaResult></ConsultaResponse></s:Body></s:Envelope>
 
Last edited:
I've tested on 11.7 and 12.8 and it works for me. Must be "feature" in 11.6.

C#:
/*------------------------------------------------------------------------
    File        : SOAPTEST.p
    Purpose     :

    Syntax      :

    Description :

    Author(s)   : james
    Created     : Tue Jun 11 13:47:07 NZST 2024
    Notes       :
  ----------------------------------------------------------------------*/

/* ***************************  Definitions  ************************** */

BLOCK-LEVEL ON ERROR UNDO, THROW.

/* ********************  Preprocessor Definitions  ******************** */


/* ***************************  Main Block  *************************** */
USING OpenEdge.Core.*.
USING OpenEdge.Net.HTTP.*.
USING OpenEdge.Net.HTTP.IHttpClientLibrary.
USING OpenEdge.Net.HTTP.Lib.ClientLibraryBuilder.
USING OpenEdge.Net.HTTP.IHttpResponse.
USING OpenEdge.Net.URI.

DEFINE VARIABLE cDLC           AS CHARACTER            NO-UNDO.
DEFINE VARIABLE oLib           AS IHttpClientLibrary   NO-UNDO.
DEFINE VARIABLE cSSLProtocols  AS CHARACTER            EXTENT 1 NO-UNDO.
DEFINE VARIABLE cSSLCiphers    AS CHARACTER            EXTENT 1 NO-UNDO.
DEFINE VARIABLE oRequest       AS IHttpRequest         NO-UNDO.
DEFINE VARIABLE oResponse      AS IHttpResponse        NO-UNDO.
DEFINE VARIABLE oURI           AS URI                  NO-UNDO.
DEFINE VARIABLE oRequestBody   AS OpenEdge.Core.String NO-UNDO.
DEFINE VARIABLE hXMLHandle     AS HANDLE               NO-UNDO.
DEFINE VARIABLE lcXML          AS LONGCHAR             NO-UNDO.
DEFINE VARIABLE ReponseXML     AS HANDLE               NO-UNDO.
DEFINE VARIABLE outputFileName AS CHARACTER            NO-UNDO.
DEFINE VARIABLE PlainTextObj   AS CLASS                OpenEdge.Core.String NO-UNDO.

ASSIGN
    cSSLProtocols[1] = 'TLSv1.2'
    cSSLCiphers[1]   = 'ECDHE-RSA-AES256-GCM-SHA384'.



/* Web Service based on this public WS http://www.dneonline.com/calculator.asmx . It consumes the WebService executing the Add Operation. */

oRequestBody =  NEW OpenEdge.Core.String(
    '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">' +
    '   <soapenv:Header/>' +
    '   <soapenv:Body>' +
    '      <tem:Consulta>' +
    '         <tem:expresionImpresa>' +
    '<![CDATA[?re=CBE070913344&rr=CCO0309098N8&tt=28903.17&id=04C979D3-2D0F-45A1-AD80-E4625B7C5192]]>' +
    '         </tem:expresionImpresa>' +
    '      </tem:Consulta>' +
    '   </soapenv:Body>' +
    '</soapenv:Envelope>'
    ).

oLib = ClientLibraryBuilder:Build()
        :sslVerifyHost(NO)
        :SetSSLProtocols(cSSLProtocols)
        :SetSSLCiphers(cSSLCiphers)
        :Library.

oURI = URI:Parse("https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc").
oRequest = RequestBuilder:Post(oUri, oRequestBody)
                         //:ContentType('text/xml; charset=UTF-8')
                         //:ContentType('text/xml')
                         :ContentType('text/xml; charset="UTF-8"')
                         :AcceptAll()
                         :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                         :Request.
                       
//oResponse = ClientBuilder:Build():UsingLibrary(oLib):ViaProxy(oURIProxy):Client:Execute(oRequest).  
oResponse = ClientBuilder:Build():UsingLibrary(oLib):Client:Execute(oRequest).

MESSAGE "oRequest:ContentType" oResponse:ContentType SKIP oResponse:StatusCode oResponse:StatusReason.

ReponseXML     = CAST(oResponse:Entity,  OpenEdge.Core.WidgetHandle):value.
//PlainTextObj = CAST(oResponse:Entity, OpenEdge.Core.String  ).
                   
outputFileName = "xmloutput.xml" .

FILE-INFO:FILE-NAME = ".".
MESSAGE FILE-INFO:FULL-PATHNAME.

//COPY-LOB FROM OBJECT PlainTextObj:Value TO FILE outputFileName.                          

ReponseXML:SAVE('FILE', outputFileName).

Response:


XML:
<?xml version="1.0" encoding="UTF-8" ?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body>
<ConsultaResponse xmlns="http://tempuri.org/">
<ConsultaResult xmlns:a="http://schemas.datacontract.org/2004/07/Sat.Cfdi.Negocio.ConsultaCfdi.Servicio" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:CodigoEstatus>S - Comprobante obtenido satisfactoriamente.</a:CodigoEstatus>
<a:EsCancelable>Cancelable con aceptación</a:EsCancelable><a:Estado>Cancelado</a:Estado>
<a:EstatusCancelacion>Plazo vencido</a:EstatusCancelacion><a:ValidacionEFOS>200</a:ValidacionEFOS>
</ConsultaResult></ConsultaResponse></s:Body></s:Envelope>
:( It is something with 11.6, With your code I still get:

oRequest:ContentType
415 Cannot process the message because the content type 'text/xml; charset="ISO-8859-1"' was not the expected type 'text/xml; charset=utf-8'.
Handle no válido. No se inicializó o apunta a un objeto eliminado. (3135)
 
You were doing this earlier, and got the same error. Or? If so, that tells me that the server does not like the quoted charset.
Code:
oRequest = RequestBuilder:Post(oUri, oRequestBody)
                        :ContentType('text/xml; charset=utf-8')
                        :AcceptAll()
                        :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                        :Request.
What I mean is,
With this ":ContentType('text/xml; charset=utf-8')" and this ":ContentType('text/xml')" the error is: "Cannot process the message because the content type 'text/xml; charset="ISO-8859-1"' was not the expected type 'text/xml; charset=utf-8'."

The charset is changed to "ISO-8859-1".

But with this code: ":ContentType('application/soap+xml; charset=utf-8')" the error is: "Cannot process the message because the content type 'application/soap+xml; charset="utf-8"' was not the expected type 'text/xml; charset=utf-8'

The charset is "utf-8", quoted, but utf-8; But, the type is "application/soap+xml;" and the required is "text/xml".

So, I would like to try something like this,

Code:
oRequest = RequestBuilder:Post(oUri, oRequestBody)
                        :ContentType('application/soap+xml; charset=utf-8')
                        :AcceptAll()
 :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                        :Request.

oHeader = oRequest:GetHeader('content-type').
oHeader:SetParameterValue('charset', 'utf-8').
oHeader:SetValue('text/xml').   /* <-- This instruction don't compile. What is the correct sentence? */
How can I set the "text/xml" to the header?
 
How can I set the "text/xml" to the header?

This is how you set it , or shold set it.
Code:
oRequest = RequestBuilder:Post(oUri, oRequestBody)
                        :ContentType('text/xml; charset=utf-8')
                        :AcceptAll()
                        :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                        :Request.

You should also set the encoding of the body object. If you don't, then the encoding of the Content-Type header will be set to whatever CPINTERNAL is, which I suspect is ISO8859-1.
Code:
oRequestBody:Encoding = 'utf-8'.


If you still want to re-add the Content-Type header, you can do something like
Code:
oHeader = HttpHeaderBuilder:Build("Content-Type: text/xml; charset=utf-8"):Header.
oRequest:SetHeader(oHeader).
 
This is how you set it , or shold set it.
Code:
oRequest = RequestBuilder:Post(oUri, oRequestBody)
                        :ContentType('text/xml; charset=utf-8')
                        :AcceptAll()
                        :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                        :Request.

You should also set the encoding of the body object. If you don't, then the encoding of the Content-Type header will be set to whatever CPINTERNAL is, which I suspect is ISO8859-1.
Code:
oRequestBody:Encoding = 'utf-8'.


If you still want to re-add the Content-Type header, you can do something like
Code:
oHeader = HttpHeaderBuilder:Build("Content-Type: text/xml; charset=utf-8"):Header.
oRequest:SetHeader(oHeader).


I get a Bad Request error message,
Code:
oRequest = RequestBuilder:Post(oUri, oRequestBody)
/*                         :ContentType('text/xml; charset=utf-8')
:                           ContentType('application/soap+xml; charset=utf-8')
*/
                        :AcceptAll()
                         :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                        :Request.
oHeader = HttpHeaderBuilder:Build("Content-Type: text/xml;charset=utf-8"):Header.
oRequest:SetHeader(oHeader).

Reviewing LOGFILE:
Code:
POST /ConsultaCFDIService.svc HTTP/1.1
User-Agent: OpenEdge-HttpClient/0.3.0 (UNIX/64) OpenEdge/11.6.3.0.1407 Lib-ABLSo
ckets/0.3.0
SOAPAction: http://tempuri.org/IConsultaCFDIService/Consulta
Host: consultaqr.facturaelectronica.sat.gob.mx
Content-Type: text/xml;charset=utf-8: 
Content-Type: text/html                             
Content-Length: 382
Accept: */*
Content-Type: text/xml;charset=utf-8: /* How to remove the ":" at the end of utf-8 */
Content-Type: text/html /* Thy system is adding this line automatically */
 
Ok, what heppens if you do just this? No extra headers.

Code:
oRequestBody:Encoding = 'utf-8'.
oRequest = RequestBuilder:Post(oUri, oRequestBody)
                         :ContentType('text/xml; charset=utf-8')
                         :AcceptAll()
                         :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                         :Request.
 
Ok, what heppens if you do just this? No extra headers.

Code:
oRequestBody:Encoding = 'utf-8'.
oRequest = RequestBuilder:Post(oUri, oRequestBody)
                         :ContentType('text/xml; charset=utf-8')
                         :AcceptAll()
                         :AddHeader('SOAPAction', 'http://tempuri.org/IConsultaCFDIService/Consulta')
                         :Request.
Compilation error: Could not locate element 'Encoding" in the class 'OpenEdge.Core.String'. (12927)
 
Back
Top