Using SoapCore 1.0.0 with .NET Core 3.1 to implement an older, WCF service. I have everything wired-up and producing a WSDL, but the WSDL is not correct. I'll simplify the cases, here, from what I have implemented, in reality.
I have a data model that is pretty basic, and of the general form:
[DataContract]
public class TopLevelInputItem
{
[DataMember]
public string SomePrimitiveValue {get; set;}
[DataMember]
public NextLevelInputItem SomeComplexValue {get; set;}
}
[DataContract]
public class NextLevelInputItem
{
[DataMember]
public string AnotherPrimitiveValue {get; set;}
}
[DataContract]
public class OutputResultItem
{
[DataMember]
public List<string> SomeOutputStrings {get; set;}
}
Operating on that is a collection of services which, of course, don't relate to the presentation of the thing as a web service, so I will skip that code. The services are reached by a set of controllers, the gist of which follow a pattern like:
[ServiceContract]
public interface IHandyWebService
{
[OperationContract]
public Task<List<OutputResultItem>> UpdateSomethingPlease(
List<TopLevelInputItem> ListOfThings);
}
public class HandyWebService : IHandyWebService
{
public async Task<List<OutputResultItem>> UpdateSomethingPlease(
List<TopLevelInputItem> ListOfThings)
{
return await aService.DoAnUpdatesAsync(ListOfThings);
}
}
The relevant part of my Startup.cs on the API project looks like this:
app.UseSoapEndpoint<IHandyWebService>("/HandyWebService", new BasicHttpsBinding(), SoapSerializer.XmlSerializer);
It's really just about that basic, but of course a lot more of it. My WSDL is not being formed correctly, with that set-up, and I hope I can explain what's happening, with some accuracy.
For the method described, I'll get something like:
<wsdl:message name="IHandyWebService_UpdateSomethingPlease_OutputMessage">
<wsdl:part name="parameters" element="tns:List`1"/>
</wsdl:message>
I.e., the "List`1" specification, as opposed to something like "ArrayOfStrings" or other type as specified within the method and annotated with DataMember.
Additionally, for my input objects, the definitions of the primitive values are not showing-up anywhere in the WSDL at all.
The data model and controllers are precisely what was in place for the service when it was based on WCF, and it all worked great. I had anticipated the ability to directly carry it all over but apparently that is not the case. What am I missing?
Perhaps part II of this question: is implementing this in .NET Core, with SoapCore, really the best angle of attack? Is there a different/better way to do it?