I have seen a c# tutorial where the instructor generates the proxy using
"Add reference "
(but he was using windows pc )
I am using a mac and I am struggling generate the proxy of a web-service with the same approach, It generates files with
system.Web.Services
a package which isn't existing in the .Net Core
I did many researches and I found that isn't included in the .Net Core, i try to add it as an externally but didn't succeed, I read some articles telling that there is an alternative called WCF, but again I didn't found it on mac, all tutorials or official documentation uses windows, I've seen that is working with a .exe which make me sure, this hell isn't existing on mac or other linux systems !
Some can help ? any ideas ? alternatives ? shortcuts ?
Thank you to read it until here !
As adding
Microsoft WCF Web Service Reference
does not work forASP.NET Core 2.1
project at the moment, you can add new.NET Standard
class library
project targeted toStandard 2.0
and add service reference to it:Add -> Connected Service
Connected Services
window selectMicrosoft WCF Web Service Reference Provider
WSDL
details as described the the guideASP.NET Core
web application (targeted to.NET Core 2.1
)You could try to install Microsoft WCF Web Service Reference Provider for VS 2017. You could follow the part “how to use the extension” to generate the client code, then copy and paste the generated code to your VS Code project.
Dot Net core is all about rest, not SOAP
My solution was based on using .Net Core CLI as in the official documentation here
Open the HelloSvcutil.csproj project file in your editor, edit the Project element, and add the dotnet-svcutil NuGet package as a CLI tool reference, using the following code:
Restore the dotnet-svcutil package using the dotnet restore command as follows:
he generated file is saved as HelloSvcutil/ServiceReference1/Reference.cs. The dotnet_svcutil tool also adds to the project the appropriate WCF packages required by the proxy code as package references.
Open the Program.cs file in your editor, edit the Main() method, and replace the auto-generated code with the following code to invoke the web service:
Run the application using the dotnet run command as follows: