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!