Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/SOAP/Client Applications    [ Add a report in this area ]  
Report #:  124627   Status: Resolved
[WinXP] [Regression in XE6] SOAP request error with XE6 after migrating XE5 project
Project:  Delphi Build #:  20.0.15596.9843
Version:    20.0 Submitted By:   Carlos Matos
Report Type:  Feature Specification issue Date Reported:  5/8/2014 4:43:58 AM
Severity:    Extreme corner case Last Updated: 8/12/2015 5:46:53 AM
Platform:    All versions Internal Tracking #:   50851
Resolution: Fixed (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (12 Total Ratings)
5.00 out of 5
Total Votes: 71
Description
I recently installed Delphi XE6 and compiled a Delphi XE5 project with XE6.
From within my application, when I try to invoke a Web service on Windows XP, I get and error saying:

The system could not locate the specified file. - URL:http://www.some_address........
SOAPAction:http://www.some_address.....

The same app/executable, compiled with XE6, works just fine on Windows 8.1.

Steps to Reproduce:
So I compared the unit Soap.SOAPHTTPTrans from XE5 and the one from XE6 and get to catch where it fails.
So in Soap.SOAPHTTPTrans from XE5, on function THTTPReqResp.Send, line 1150, we have:
-----------
{$IFDEF UNICODE}
WinInetResult := HttpSendRequest(Request, nil, 0,
DatStr.Bytes, DatStr.Size);
{$ELSE}
WinInetResult := HttpSendRequest(Request, nil, 0,
@DatStr.DataString[1],
Length(DatStr.DataString));
{$ENDIF}

if not WinInetResult then
RetVal := HandleWinInetError(GetLastError, Request, True);
-----------

And in Soap.SOAPHTTPTrans from XE6, we have:
-----------
{$IFDEF UNICODE}
HttpSendRequest(Request, nil, 0,
DatStr.Bytes, DatStr.Size);
{$ELSE}
HttpSendRequest(Request, nil, 0,
@DatStr.DataString[1],
Length(DatStr.DataString));
{$ENDIF}
RetVal := HandleWinInetError(GetLastError, Request, True);
-----------

and it's in here that this fails.

If I change this block of code equals to what comes with XE5, everything will work just fine, either on Windows XP and Windows 8.1.
Workarounds
None
Attachment
Test.zip
Comments

Tomohiro Takahashi at 5/8/2014 10:26:55 PM -
> ... I try to invoke a Web service on Windows XP, ...
Does your issue occur only on Windows XP? What about Vista or later?

Delphi XE6(RAD Studio XE6) does not support XP.
[Delphi XE6 Datasheet]
https://www.embarcadero.com/products/delphi/datasheet
--------
Supported Deployment Platforms

PCs and tablets with Intel/AMD processors running Windows Vista, 7, 8.x or later. ...
--------

Carlos Matos at 5/9/2014 7:11:31 AM -
And forgive me Tomohiro but this:
> Supported Deployment Platforms

> PCs and tablets with Intel/AMD processors running Windows Vista, 7, 8.x or later. ...

it Is absolutly rediculous. What should I say to my Windows XP clients? Buy a later version of Windows?
Not a solution. We can not buy a new version of a development tool and loose clients.

Carlos Matos at 5/9/2014 4:32:34 AM -
It only occurs on Windows XP. On Windows 7, 8 and 8.1 is ok.

Rafael Dipold at 6/3/2014 10:19:54 AM -
You have test on windows 7 with which version of Internet Explorer?

I test here with IE 9 (default win7 installation) and get the error.

I just update the IE 9 to IE 11 and the error don´t happen anymore.

Carlos Matos at 6/6/2014 4:44:22 AM -
IE v11.

Tomohiro Takahashi at 5/8/2014 10:26:48 PM -
Could you please attach sample project(server/client) to reproduce/confirm your issue?

Rafael Dipold at 6/3/2014 10:45:13 AM -
I can confirm that the code change proposal by Carlos Matos solves the problem.

I get random error when using versions of (Windows XP) or (Windows 7 with IE 9):

Error: "The supplied user buffer is not valid for the requested operation"

In (Windows 7 + IE 11) or (Windows 8) the same compiled code works fine.

If I change this block of code equals to what comes with XE5, everything will work just fine, either on Windows XP/Vista/7/8.

Carlos Matos at 5/9/2014 6:56:28 AM -
I attached an example with the problem. The same executable run just fine on my Windows 8.1 machine.
If you make the changes I mentioned to Soap.SOAPHTTPTrans.pas, it will run ok on both Windows Xp and Windows 8.1 machines.

Carlos Matos at 5/9/2014 4:33:41 AM -
Well, this is a big project. I'll try to isolate the code and I'll back here.

Eray HANOGLU at 5/16/2014 5:35:59 AM -
I m getting same problem and getting a big trouble here.

A hotfix is needed immetiately.

Registered User at 8/27/2014 12:28:17 AM -
We 're getting the same problem too.
Windows 7, IE9

Why was that code changed from XE5 to XE6? In XE5 it looked quite well.

Ettore Bottega at 6/12/2014 1:56:57 AM -
I am getting the same problem.
I can post a project that raises the error when requesting from http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL and DOES NOT when requesting from http://www.webservicex.net/globalweather.asmx?WSDL

My sources work fine building in DelphiXE5, but not in DelphiXE6. Tthe destination platform is a Win7 Ent. 32-bit, but the problem persists when building for a Win 2008 server 64-bit.

Rafael Dipold at 6/4/2014 12:09:07 PM -
Workaround:

1. Copy (XE6 Install Folder)\source\soap\Soap.SOAPHTTPClient.pas to your project folder.

2. Copy (XE6 Install Folder)\source\soap\Soap.SOAPHTTPTrans.pas to your project folder.

3. Add this units to your project.dpr:

  Soap.SOAPHTTPTrans in 'Soap.SOAPHTTPTrans.pas',
  Soap.SOAPHTTPClient in 'Soap.SOAPHTTPClient.pas',


4. Change the code block in Soap.SOAPHTTPTrans:

--------------------------------------------------------------
{$IFDEF UNICODE}
  HttpSendRequest(Request, nil, 0,
                  DatStr.Bytes, DatStr.Size);
{$ELSE}
  HttpSendRequest(Request, nil, 0,
                  @DatStr.DataString[1],
                  Length(DatStr.DataString));
{$ENDIF}
  RetVal := HandleWinInetError(GetLastError, Request, True);
--------------------------------------------------------------

TO:

--------------------------------------------------------------
{$IFDEF UNICODE}
  WinInetResult := HttpSendRequest(Request, nil, 0,
                                   DatStr.Bytes, DatStr.Size);
{$ELSE}
  WinInetResult := HttpSendRequest(Request, nil, 0,
                                   @DatStr.DataString[1],
                                   Length(DatStr.DataString));
{$ENDIF}

  if not WinInetResult then
    RetVal := HandleWinInetError(GetLastError, Request, True);
--------------------------------------------------------------

5. Build all and everything will work fine, either on Windows XP/Vista/7/8

Luis Mani at 1/27/2015 5:38:03 PM -
Hello.
This issue is still present in Delphi XE7 when running application in WinXP SP3 32-bit.
Does Update 1 solve it?

I had the same problem in Win7 SP1 x64. Updated Internet Explorer to version 11 and that solved it.

Thanks in advance.

El Pelocn at 3/19/2015 9:08:09 AM -
Similar problems with XP...

My guessing is that it is related with the CA root certificates of XP, Microsoft end XP support on April 2014.

Server Response from: ETNACODE01