0

I have a .NET Core 3.1 project, to which I need to add a web service. I can add it regularly as a service reference, however it does not work, returns "There was no endpoint listening at "xxx" that could accept the message. This is often caused by an incorrect address or SOAP action".

Now, the service is up and running, and connections are triple checked and completely ok. I've made a .NET Framework 4.5 app, to emulate the work of the Core application, and there when I add it as a service reference, it returns the same error.

However, when i add it as a web reference (which generates code based on FW 2.0), it works properly. (that option is not available in Core, at least not to my knowledge)

Is there any way to emulate generating the code based on 2.0 in .NET Core, i've tried using dotnet-svcutil (no additional configuration, just the basic install), but still to no awail.

Any help?

2
  • It's been quite a while, but IIRC Web Reference is for the very old school asmx soap web services, Service Reference was intended for WCF. Have you tried copying the working code that files that were generated into your new .net core project? Commented Oct 13, 2023 at 15:03
  • @ste-fu absolutely correct, its a very old soap web service, communicating with something government related so no wonder lol In the end just decided to manually create soap envelopes upon request and send them through http request, and completely disregard the functions in the web service thanks for the help anyways! Commented Oct 16, 2023 at 10:29

1 Answer 1

0
  • Double check that the endpoint address and bindings are correct in the service reference configuration. Small mistakes in the URL or contract names can lead to these connectivity issues.
  • Try updating the service reference to use basicHttpBinding rather than the default wsHttpBinding. Basic binding is more interoperable and may connect better from .NET Core.
  • Generate the service proxy code using a tool like svcutil or wsdl.exe instead of adding the service reference. It gives you more control over the binding configurations. You can specify basicHttpBinding here.
  • For svcutil, use the /serviceContract option to specify the interface namespace and class name explicitly. The generated code may work better if you control the contract naming.
  • As a last resort, try hosting the web service in IIS instead of self-hosted, if possible. IIS-hosted services play nicer with .NET Core in some cases.
  • Review the .NET Core compatibility for the SOAP libraries you're using on the service implementation. Some older libs like ASMX have limitations on .NET Core. The key is getting the right mix of binding, contract names, and namespace mappings between the client proxy code and the actual service. With trial and error, you should be able to find a generation approach that creates compatible code for your scenario.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.