Как настроить мой .NET CORE 6 API Служба API, чтобы ожидать моего желаемого пространства имен? >
Код: Выделить всё
[DataContract(Name = "TestCustomModel", Namespace = "https://myNamespace.com")]
public class MyCustomModel
{
[DataMember]
public int username { get; set; }
[DataMember]
public string password { get; set; }
[DataMember]
public int orgId { get; set; }
[DataMember]
public int poolId { get; set; }
[DataMember]
public string cycleStartDate { get; set; }
}
< /code>
my service: < /p>
[ServiceContract(Namespace = "https://myNamespace.com")]
public class SampleService : ISampleService
{
public string Test(string s)
{
Console.WriteLine("Test Method Executed!");
return s;
}
public void XmlMethod(XElement xml)
{
Console.WriteLine(xml.ToString());
}
public MyCustomModel TestCustomModel(MyCustomModel customModel)
{
return customModel;
}
}
< /code>
Мой сервисный интерфейс: < /p>
[ServiceContract]
public interface ISampleService
{
[OperationContract]
string Test(string s);
[OperationContract]
void XmlMethod(System.Xml.Linq.XElement xml);
[OperationContract]
MyCustomModel TestCustomModel(MyCustomModel inputModel);
}
< /code>
Вот мыло, которое я отправляю: < /p>
USERNAME
PASSWORD
123
1234
2023-01-01
На основе того, что я мог найти, я считаю, что устанавливаю пространство имен в правильных местах, но все же ожидает tempuri.org
Подробнее здесь: https://stackoverflow.com/questions/756 ... h-soapcore
Мобильная версия