Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Calling SOAP webservices from 64-bit DLL


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Feb 20, 2015 12:51 AM Last Post By: Attila Molnár
Timothy Woodward

Posts: 1
Registered: 12/11/02
Calling SOAP webservices from 64-bit DLL  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 21, 2015 4:07 AM
Hi,

My project needs to call SOAP-based webservices. Unfortunately it seems that there may be a problem performing such webservice calls from 64-bit DLLs under IIS, which is how my project will be deployed.

See for example the following public webservice:

http://www.webservicex.net/geoipservice.asmx?WSDL

After creating a test ISAPI webserver project and importing the WSDL above, I tried using the following code to make a webservice call:

uses activeX, geoipservice;

procedure TWebModule1.WebModule1DefaultHandlerAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
CountryName : string;
I : GeoIPServiceSoap;
G : GeoIP2;
begin
CoInitialize(nil);
try
CountryName := 'unassigned';
I := GetGeoIPServiceSoap();
if assigned(I) then begin
G := I.GetGeoIP('...insert IP address here...');
if assigned(G) then begin
countryname := G.CountryName;
end;
end;
Response.Content :=
'<html>' +
'<head><title>Web Service Test</title></head>' +
'<body>Country: ' + CountryName + '</body>' +
'</html>';
except
on E : exception do begin
Response.Content :=
'<html>' +
'<head><title>Web Service Test</title></head>' +
'<body>Exception: ' + E.ClassName() + ' ' + E.Message + '</body>' +
'</html>';
end;
end;
CoUninitialize();
end;

When I run the project as a 32-bit ISAPI DLL, viewing the website in the browser results in a country name being displayed as expected. When I run the project as a 64-bit ISAPI DLL, viewing the website in the browser results in the following error message being displayed (Zugriffsverletzung = access violation):

Exception: EAccessViolation Zugriffsverletzung bei Adresse 000000C700492460. Schreiben von Adresse 000000C700492460

Has anybody else encountered this problem or has an idea how to solve it?

Setup: Delphi XE6, Win8.1, IIS 8.5

Many thanks
Tim

Edited by: Timothy Woodward on Jan 21, 2015 4:48 AM

Removed erroneous reference to UniGui
Christen Blom-D...

Posts: 1
Registered: 11/22/04
Re: Calling SOAP webservices from 64-bit DLL  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 19, 2015 11:43 AM   in response to: Timothy Woodward in response to: Timothy Woodward
I've the same problem. It happens with Windows 8.1 (Windows 7 64 bits working ok).
I've traced the problem to the procedure System.RTTI.RawIntercept.

Best regards

Christen

Timothy Woodward wrote:
Hi,

My project needs to call SOAP-based webservices. Unfortunately it seems that there may be a problem performing such webservice calls from 64-bit DLLs under IIS, which is how my project will be deployed.

See for example the following public webservice:

http://www.webservicex.net/geoipservice.asmx?WSDL

After creating a test ISAPI webserver project and importing the WSDL above, I tried using the following code to make a webservice call:

uses activeX, geoipservice;

procedure TWebModule1.WebModule1DefaultHandlerAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
CountryName : string;
I : GeoIPServiceSoap;
G : GeoIP2;
begin
CoInitialize(nil);
try
CountryName := 'unassigned';
I := GetGeoIPServiceSoap();
if assigned(I) then begin
G := I.GetGeoIP('...insert IP address here...');
if assigned(G) then begin
countryname := G.CountryName;
end;
end;
Response.Content :=
'<html>' +
'<head><title>Web Service Test</title></head>' +
'<body>Country: ' + CountryName + '</body>' +
'</html>';
except
on E : exception do begin
Response.Content :=
'<html>' +
'<head><title>Web Service Test</title></head>' +
'<body>Exception: ' + E.ClassName() + ' ' + E.Message + '</body>' +
'</html>';
end;
end;
CoUninitialize();
end;

When I run the project as a 32-bit ISAPI DLL, viewing the website in the browser results in a country name being displayed as expected. When I run the project as a 64-bit ISAPI DLL, viewing the website in the browser results in the following error message being displayed (Zugriffsverletzung = access violation):

Exception: EAccessViolation Zugriffsverletzung bei Adresse 000000C700492460. Schreiben von Adresse 000000C700492460

Has anybody else encountered this problem or has an idea how to solve it?

Setup: Delphi XE6, Win8.1, IIS 8.5

Many thanks
Tim

Edited by: Timothy Woodward on Jan 21, 2015 4:48 AM

Removed erroneous reference to UniGui

Edited by: Christen Blom-Dahl on Feb 20, 2015 12:46 AM
Attila Molnár

Posts: 7
Registered: 12/2/09
Re: Calling SOAP webservices from 64-bit DLL  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 20, 2015 12:51 AM   in response to: Timothy Woodward in response to: Timothy Woodward
Hi!

Try to turn off DEP (Data Execution Prevention) on your dll host exe.

Timothy Woodward wrote:
Hi,

My project needs to call SOAP-based webservices. Unfortunately it seems that there may be a problem performing such webservice calls from 64-bit DLLs under IIS, which is how my project will be deployed.

See for example the following public webservice:

http://www.webservicex.net/geoipservice.asmx?WSDL

After creating a test ISAPI webserver project and importing the WSDL above, I tried using the following code to make a webservice call:

uses activeX, geoipservice;

procedure TWebModule1.WebModule1DefaultHandlerAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
CountryName : string;
I : GeoIPServiceSoap;
G : GeoIP2;
begin
CoInitialize(nil);
try
CountryName := 'unassigned';
I := GetGeoIPServiceSoap();
if assigned(I) then begin
G := I.GetGeoIP('...insert IP address here...');
if assigned(G) then begin
countryname := G.CountryName;
end;
end;
Response.Content :=
'<html>' +
'<head><title>Web Service Test</title></head>' +
'<body>Country: ' + CountryName + '</body>' +
'</html>';
except
on E : exception do begin
Response.Content :=
'<html>' +
'<head><title>Web Service Test</title></head>' +
'<body>Exception: ' + E.ClassName() + ' ' + E.Message + '</body>' +
'</html>';
end;
end;
CoUninitialize();
end;

When I run the project as a 32-bit ISAPI DLL, viewing the website in the browser results in a country name being displayed as expected. When I run the project as a 64-bit ISAPI DLL, viewing the website in the browser results in the following error message being displayed (Zugriffsverletzung = access violation):

Exception: EAccessViolation Zugriffsverletzung bei Adresse 000000C700492460. Schreiben von Adresse 000000C700492460

Has anybody else encountered this problem or has an idea how to solve it?

Setup: Delphi XE6, Win8.1, IIS 8.5

Many thanks
Tim

Edited by: Timothy Woodward on Jan 21, 2015 4:48 AM

Removed erroneous reference to UniGui
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02