SoapCore icon indicating copy to clipboard operation
SoapCore copied to clipboard

Slashes not admitted in Endpoint

Open GabrieleGuelfi opened this issue 2 years ago • 1 comments

I have defined my Endpoint in the Setup class as:

endpoints.UseSoapEndpoint<PvaReadService>($"/Service/lettura/pva.ws", new SoapEncoderOptions(), SoapSerializer.XmlSerializer, caseInsensitivePath: true, null, settings);

And in the appsettings I have defined the following:

"FileWSDL": {
  "UrlOverride": "",
  "WebServiceWSDLMapping": {
    "Serviceletturapva.ws": {
      "WsdlFile": "PVAServiceLettura_v3.0.wsdl",
      "SchemaFolder": "wsdl/schema",
      "WsdlFolder": "wsdl/interfacesTest/lettura",
    }
  },
  "VirtualPath": ""
}

But when I search “http://localhost:3000/Service/scrittura/pva.ws” it returns a 404 NotFound error. It looks like slashes are completely removed because “http://localhost:3000/Servicescritturapva.ws” returns the correct file instead.

I would appreciate the possibility to define an Endpoint as a path with also slashes inside.

Thanks!

GabrieleGuelfi avatar Sep 16 '22 13:09 GabrieleGuelfi

Yup, that is a weird behavior that could be hard to change. There is the TrailingServicePathTuner that you can register in startup. That will result in everything up until the last slash will be tossed out, meaning that your example will work. But it also means that every path will work, as long as the "ending" is correct.

That is if I understand things correctly 😉

If you want to add support for paths with /, without using the TrailingServicePathTuner, you are more than welcome to submit a PR. There is a risk though, that people rely on the funky behavior when combined with the Tuner, so it would probably need to be opt-in.

andersjonsson avatar Sep 16 '22 13:09 andersjonsson

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 17 '22 04:10 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Nov 01 '22 03:11 github-actions[bot]