VB6 calling WCF: Could not find endpoint element

paulsm4

I have a legacy VB6 app that needs to call .Net .dll in order to invoke a WCF web service.

At first, I got this annoying message:

Could not find endpoint element with name 'DocumentMetadataPortSOAP12' and contract 'CODSRef.DocumentMetadataType' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.

I followed this link - Using app.config with Interop Controls - and it helped me get my VB6 test exe working:

1) Copied an app.config from a net test client

2) Renamed it MyVb6Test.exe.config (the same name as the VB6 exe).

So far, so good.

CURRENT PROBLEM:

The actual client is a VB6.exe that calls a VB6 .dll, which calls the .Net/COM-aware .dll:

  MyLegacyVb6App.exe
    +-> MyNewVB6plugin.dll
          +-> MyNewdotNet.dll
                +-> WCF

Even though I created MyLegacyVb6App.exe.config - exactly like the working VB6 test - I'm still getting "Could not find endpoint element with name 'DocumentMetadataPortSOAP12'..."

Here's the .Net code in "MyNewDotNet.dll":

DocNotificationRequesttype wsRequest = new DocNotificationRequesttype();
DocumentMetadataTypeClient wsClient =  new DocumentMetadataTypeClient("DocumentMetadataPortSOAP12",  m_wsUrl);
DocNotificationResponsetype wsResponse = wsClient.DocNotification(wsRequest);

Q: Is there any reason I actually need an "app.config"? Is there any way I can "hard code" whatever it needs directly in my C# code?

Q: What other alternatives do I have for my scenario: VB6 exe -> VB6 .dll -> .Net/Interop .dll => WCF???

Thank you very much in advance!

paulsm4

I was able to resolve the problem by using an App.config after all.

PROBLEM:

Because my .Net .dll was being invoked from a VB6/COM .dll called from a VB6 .exe (with gosh knows how many VB6/COM components in the middle) ... .Net happened to be looking for the app.config in an UNEXPECTED place - NOT in thw same directory as the VB6 .exe itself (?!?)

SOLUTION:

I used AppDomain.CurrentDomain.SetupInformation.ConfigurationFile tp get the actual location where .Net was looking for app.config:

LogMsg(">>AppConfigFile=" + AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

WCF This could be due to the service endpoint binding not using the HTTP protocol

From Dev

Could not find default endpoint element that references contract 'IAuthenticationService' in the ServiceModel client configuration section

From Dev

WCF Exception: Could not find a base address that matches scheme http for the endpoint

From Dev

Error Bad Calling Convention when debugging vb6 program

From Dev

PayPal SDK: PayPal error: Could not find endpoint for live.dyson

From Dev

JMeter and WCF with TCP endpoint

From Dev

Could not find default endpoint element that references contract 'SumServiceReference.IService1' in the ServiceModel client configuration section

From Dev

Could not find endpoint element with name '' and contract '' in the ServiceModel client configuration section

From Dev

WCF Runtime Exception "Could not find default endpoint element that references..."

From Dev

WCF Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding

From Dev

Could not find endpoint element with name WCF

From Dev

WCF error "there was no endpoint listening at ..."

From Dev

Android: `Could not find element /manifest/application` issue

From Dev

WCF Endpoint Error: Could not find default endpoint element

From Dev

There Was No Endpoint Listening at http // That Could Accept The Message in WCF

From Dev

Could not find default endpoint element that references contract

From Dev

Selenium Webdriver IE could not find element

From Dev

Error Bad Calling Convention when debugging vb6 program

From Dev

WCF Service - Endpoint is not showing

From Dev

calling mysql query in vb6

From Dev

Could not find default endpoint element that references contract 'SumServiceReference.IService1' in the ServiceModel client configuration section

From Dev

WCF Runtime Exception "Could not find default endpoint element that references..."

From Dev

WCF Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding

From Dev

Could not find endpoint element with name 'Address:http://example.com:8123/blmrg/test_ws/Service1.svc

From Dev

How to use a WCF Web Service in VB6

From Dev

Consume WCF service in winform, how to dynamically set Endpoint element and contract

From Dev

Could not find default endpoint element that references contract

From Dev

VB6 calling WCF: Could not find endpoint element

From Dev

Could not find endpoint element when consume WCF service

Related Related

  1. 1

    WCF This could be due to the service endpoint binding not using the HTTP protocol

  2. 2

    Could not find default endpoint element that references contract 'IAuthenticationService' in the ServiceModel client configuration section

  3. 3

    WCF Exception: Could not find a base address that matches scheme http for the endpoint

  4. 4

    Error Bad Calling Convention when debugging vb6 program

  5. 5

    PayPal SDK: PayPal error: Could not find endpoint for live.dyson

  6. 6

    JMeter and WCF with TCP endpoint

  7. 7

    Could not find default endpoint element that references contract 'SumServiceReference.IService1' in the ServiceModel client configuration section

  8. 8

    Could not find endpoint element with name '' and contract '' in the ServiceModel client configuration section

  9. 9

    WCF Runtime Exception "Could not find default endpoint element that references..."

  10. 10

    WCF Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding

  11. 11

    Could not find endpoint element with name WCF

  12. 12

    WCF error "there was no endpoint listening at ..."

  13. 13

    Android: `Could not find element /manifest/application` issue

  14. 14

    WCF Endpoint Error: Could not find default endpoint element

  15. 15

    There Was No Endpoint Listening at http // That Could Accept The Message in WCF

  16. 16

    Could not find default endpoint element that references contract

  17. 17

    Selenium Webdriver IE could not find element

  18. 18

    Error Bad Calling Convention when debugging vb6 program

  19. 19

    WCF Service - Endpoint is not showing

  20. 20

    calling mysql query in vb6

  21. 21

    Could not find default endpoint element that references contract 'SumServiceReference.IService1' in the ServiceModel client configuration section

  22. 22

    WCF Runtime Exception "Could not find default endpoint element that references..."

  23. 23

    WCF Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding

  24. 24

    Could not find endpoint element with name 'Address:http://example.com:8123/blmrg/test_ws/Service1.svc

  25. 25

    How to use a WCF Web Service in VB6

  26. 26

    Consume WCF service in winform, how to dynamically set Endpoint element and contract

  27. 27

    Could not find default endpoint element that references contract

  28. 28

    VB6 calling WCF: Could not find endpoint element

  29. 29

    Could not find endpoint element when consume WCF service

HotTag

Archive