web-service call from inside a web-service - AV

web-service call from inside a web-service - AV

Post by const * co » Wed, 19 Sep 2007 23:55:58

BCB6 patched.

I have an ISAPI web-service (MyWebService1) which internally calls another
web-service (MyWebService2) on another server. This call on all machines
(but my own) throws an EAccessViolation.

1) I have implimented the fixes described at QualityCentral that require
some rebuilding of the VCL (for bugs inside xmldoc, wsdlnode and
OpToSoapDomConv). And for years this has been working just fine. Now
however I have had to add the call from inside the ISAPI (MyWebService1) to
a different web-service elsewhere (MyWebService2) and I am having the issue.

2) MyWebService1 is a static build (no runtime packages, no dynamic RTL).

3) On my machine it works every time. (Except in one case - read on). On
other machines it fails every time. The web-app de *** module version
works every time on all machines.

4) I wrote a simple win32 test application that uses the exact same import
of MyWebService2 to invoke the methods and it works fine every time on all

5) On other machines an AV is thrown when any method of the interface is
called. The interface pointer is obtained normally and is definitely not
NULL. It doesnt matter which method I call, all methods *** the same

6) From monitoring the code and communication on the remote machine - the
call is defiinitely not being transmitted.

In trying to trace to the point to where the AV happens, I have been adding
OutputDebugString() to the code into deeper and deeper layers and then
executing it on another machine (which shows the bad behaviour). I do not
have remote debugging unfortunately. Finally I have found myself inside
TRIO.Generic. and TRIO.GenericStub. (Found inside unit RIO.pas) and I still
can not seem to locate it.

First I tried adding a message inside Generic() and found it was too late -
GenericStub seemed to be throwing the Exception. Fine, so I added a message
to GenericStub as the first line. Still it doesnt seem early enough...
where the hell is this thring throwing the AV from? It does not seem to be
any of the units I have rebuilt from the VCL (the only one involved seems to
be OpToSoapDomConv and its methods dont get called before the AV happens).

Why cant I reproduce it on my machine? Every other machine has the problem
(I stinks like a machine config problem - but I cant see it, I have triple
checked everything I can think of). And I am fairly certain it is a static
link - so all the dependencies should be taken care of.... what am I

Here is some code:

bool __fastcall TMyWebService1::DoStuff(AnsiString & AServerErrorMsg)
// get the ws interface pointer (I have tried several combinations
// of UseWSDL and Addr in this call, all with the same results)
_di_IMyWebService2 pIPS = GetIMyWebService2(true);

if (!pIPS)
freak out;

// call a method:
const int InterfaceVer = pIPS->InterfaceVersion();
// ** crashes before the method is actually sent.


Any ideas?

1. InvocationTargetException when calling "new Service()" in Axis web service to call another web service

2. Calling Web Service that calls other Web Service with Windows Authentication

Hi all

I would like to now the answer to the following problem, if someone can

Given a windows application client that's calling a web service (using
default credentials) the
web service gets invoked fine with the users credentials. However they
to call a second web service from the first one. When it hits the
second web
service, the web service (even though configured correctly) always
reports (401) Unauthorized.

Is there any possibility to do this or is impossible ?

Is possible to implement any workaround for this problem ?

Thanks in advance

Manuel Brand

3. Calling Web Service that calls other Web Service with Windows Auth

4. Calling Web Service that calls other Web Service with Windows Authentication

5. Controlling Web Service Timeout from inside web service

6. Multiple web service calls from web service

7. Web service calling a web service.

8. Problem: My web service calls only open a single connection to the web service machine

9. Calling a Web Service using Axis, from within an Axis Web Service running under Tomcat

10. SSRS - Retrieving XML data from a web service/calling web service from report problems...

11. Calling a web service from a web service

12. Calling one web service from another web service

13. call secure web service (thru cer) from a web service

14. Web service autentication problem when call another web service