I am using RAD Studio 11 to build Multi-Device Application in Delphi to act as SOAP Client against OpenEdge WEB Services and produce needed types and classes via WSDL Importer.
Win32 and Win64 built applications works without any problems and everything goes fine. The problem appears in Android app. Using TCPMon in proxy mode to intercept SOAP requests and responses I found that Android app adds 3 bytes BOM(0xEF,0xBB,0xBF) in the beginning of SOAP envelope:
BOM<?xml version="1.0"?><SOAP-ENV:Envelope xmlns:SOAP-ENV ...
This is caused error in server side parsing with message:
<errorMessage>
Error in SOAP Envelope: parsing error: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. (10913)
</errorMessage>
The question is how to disable BOM in requests provided by THTTPRIO type when compiling for Android.
I can not test the application in iOS and macOS (have no MAC PC).
Here is IInvokable interface implementation from WSDL importer and couple lines added by me:
function GetLBLObj(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): LBLObj;
const
defWSDL = 'http://server:8080/wsa/wsa1/wsdl?targetURI=urn:service:LBL';
defURL = 'http://server:8080/wsa/wsa1';
defSvc = 'LBLService';
defPrt = 'LBLObj';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
RIO.HTTPWebNode.UseUTF8InHeader := True;
RIO.HTTPWebNode.Proxy := 'http://tcpmon:8081';
try
Result := (RIO as LBLObj);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;
Thank You in advance!