CoreWCF / samples

MIT License
38 stars 19 forks source link

XML or SOAP request example #19

Closed programmersommer closed 2 years ago

programmersommer commented 2 years ago

Couldn't find any useful example of how to use SOAP/XML requests. This makes update from WCF to CoreWCF senseless.

When I am trying to send next one content:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
   <s:Header/>
   <s:Body>
      <tem:Echo>
         <tem:text>A</tem:text>
      </tem:Echo>
   </s:Body>
</s:Envelope>

to endpoint http://localhost:8088/EchoService/basichttp

Then I am getting 202 response and not getting response text "Received A from client!" I have tried different headers (Content-Type and Action/SOAPAction) and different configuration settings like:

options.AllowSynchronousIO = false;

Have also tried to return "Retry-After" header from CoreWCF Server application.

Version used: 1.0 Missing samples how to use 1.1 (it requires authorization to be configured) If update CoreWCF packages to 1.1 in sample NetCoreServer, you will get exception

Unable to resolve service for type 'Microsoft.AspNetCore.Authentication.IAuthenticationSchemeProvider' while attempting to activate 'Microsoft.AspNetCore.Authentication.AuthenticationMiddleware'.'

even if add .ConfigureServiceHostBase<EchoService> with self-signed certificate

programmersommer commented 2 years ago

Was able to get 200 response with small modification. Namespace was added to ServiceContract attribute [ServiceContract(Namespace = "http://www.contoso.com")]

Here is how request from Postman is looking out: postman-1 postman-2

Issue with version 1.1 still stays. Application doesn't works after updating packages.

programmersommer commented 2 years ago

Update. Still couldn't use SOAP 1.2 with wsHttp, basicHtttp or even custom binding. Getting 202. Sample of usage would be very appreciated.

programmersommer commented 2 years ago

Was able to get SOAP XML using Fiddler. After creating WCF project have created Client project with service reference in it. And executed call to backend could be easily catched with Fiddler.