Trying to find a way to add metadata to a SoapCore XML service developed in .net core 3.1

227 Views Asked by At

I have implemented a fairly straightforward Soap 12 XML service using SoapCore to read the XML request and send a response.

My issue now is that the client requires the metadata to be accessible and after doing a lot of research online I can find plenty of examples of how to consume but not how to add metadata to my service, especially using Core.

From looking at the examples I have found it looks like the startup.cs is where I may need to make changes/additions this currently looks as follows:

var transportBinding = new HttpTransportBindingElement();
            var textEncodingBinding = new TextMessageEncodingBindingElement(MessageVersion.Soap12WSAddressing10, System.Text.Encoding.UTF8);
            var customBinding = new CustomBinding(transportBinding, textEncodingBinding);
            app.UseSoapEndpoint<ICallbackService>("/ExportShipments", customBinding, SoapSerializer.XmlSerializer);
            app.UseSoapEndpoint<ICallbackService>("/SetShipmentsToCompleted", customBinding, SoapSerializer.XmlSerializer);
            app.UseSoapEndpoint<ICallbackService>("/ExportProductQuantitiesForNewOrders", customBinding, SoapSerializer.XmlSerializer);

The client is trying to access mydomain.com/ExportShipments/$metadata.

The client is currently receiving the below error, I am assuming this is because I have not done anything to accommodate the metadata request.

ErrorMessage received by client

0

There are 0 best solutions below