SOAP in .NET Core?

前端 未结 6 1386
耶瑟儿~
耶瑟儿~ 2020-12-15 05:36

How you do SOAP in .NET Core? Are there any equivalents of Apache CXF in .Net Core (not just a simple SOAP client but full featured stack)?

Sorry if this is a very b

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-15 05:55

    Here u have a little trick I used targeting "framework 452" in an ASP.Net 5.0 Web App.

    Unfortunately the new "Add connected service" -> "WCF service" only works when targeting ".Net Core", so I created a basic console app with same name as my web app.

    Console apps allow to add "Service reference". Once added VS2015 creates all service references in folder "Service References".

    Just move folder contents to Web solution and use a client constructor that accepts HttpBindings and EndPointparameters.

    In my case I'm connecting to Echosign service initializing client as follows:

    using (EchoSignDocumentService16PortTypeClient service = new EchoSignDocumentService16PortTypeClient(new BasicHttpBinding(BasicHttpSecurityMode.Transport), new EndpointAddress(affffdress)))
    {
    ...
    }
    

提交回复
热议问题