Jump to content
ertank

Two SOAP services with identical interface name leads access violation

Recommended Posts

Hello,

 

I am trying to figure out a way to use two Veriban SOAP web services in a single project. These web services both are named same as IIntegrationService in imported WSDL units.

 

http://efaturatransfertest.veriban.com.tr/IntegrationService.svc?wsdl

http://earsivtransfertest.veriban.com.tr/IntegrationService.svc?wsdl

 

For anyone interested, Veriban publicly make it available test user and password. Same for both webservices above.

Username: TESTER@VRBN

Password: Vtest*2020*

 

If I build two separate VCL applications each using one of these services WSDL imported unit, everything is fine and works. But, If I rename WSDL imported units like VeribanEInvoiceIntegrationService.pas and VeribanEArchiveInvoiceIntegrationService.pas and put these files in uses section of a single VCL project. Login method runs fine for both of them. But VeribanEArchiveInvoiceIntegrationService.pas one gives me access violation for below method. My final goal is to use these services both in a single Windows Service project which currently gets same AV exception. It did not help to have wrapper classes for each service in a separate unit.

 

http://earsivtransfertest.veriban.com.tr/IntegrationService.svc method GetSalesInvoiceUUIDListWithCustomerWithDate

 

I make sure that I refer to each unit interface when casting THTTPRIO as below
 

var
  RIO: THTTPRIO;
  WS: VeribanEArchiveInvoiceIntegrationService.IIntegrationService;
  LResponse: VeribanEArchiveInvoiceIntegrationService.ArrayOfString;
begin
...
  WS := (RIO as VeribanEArchiveInvoiceIntegrationService.IIntegrationService);
...
  LResponse := WS.GetSalesInvoiceUUIDListWithCustomerWithDate(FSessionCode, LStartDate, LEndDate);  // AV here

 

My questions are:

- Is there anything that I am missing which leads to AV?

- Is it possible to use both of these services in a single project?

 

Thanks & Regards,

Ertan

 

P.S. I attached AV call stack just in case.image_2023-06-28_174557687.thumb.png.27a239958086ca4dba2f2e2d5a8aea32.png

Share this post


Link to post

Do the two interfaces have the same GUID in the two units? If so you are probably sunk since the Delphi SOAP framework cannot distinguish between them. In this case you would have to build two separate modules (e.g. DLLs with the same exported interface,  not packages!) then used by the service.

Share this post


Link to post
On 6/29/2023 at 2:59 PM, PeterBelow said:

Do the two interfaces have the same GUID in the two units?

I do not see that GUID information in WSDL or in imported unit.

Do you know where can I find it?

Share this post


Link to post
18 hours ago, ertank said:

I do not see that GUID information in WSDL or in imported unit.

Do you know where can I find it?

If the units generated by the SOAP importer declare the interface types without a GUID just try to add one (Ctrl-Shift-G if I remember correctly, with caret on a new line after the one with the interface keyword).

Share this post


Link to post
On 7/1/2023 at 5:05 PM, PeterBelow said:

If the units generated by the SOAP importer declare the interface types without a GUID just try to add one (Ctrl-Shift-G if I remember correctly, with caret on a new line after the one with the interface keyword).

Yes, I now see that both web services are defined using the same GUID by WSDL importer. Their methods are different, things they do are different but both has identical name and GUIDs.

image.png.9d218d54a9d9732a034837e468778d0c.png

 

After manually changing one of them to use a different GUID everything worked just fine in a single project.

 

Thank you.

 

P.S. I already build two separate DLLs and released them. They are working OK. But this GUID is something I will check for the future.

Edited by ertank

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×