[英]Create a SOAP based Web Service that stores data from request to database
I have been asked to create a SOAP based web service (company is typically Microsoft-centric and I will attempt to do this in Visual Studio/C#) which does the following: 我被要求创建一个基于SOAP的Web服务(公司通常以Microsoft为中心,我将尝试在Visual Studio / C#中做到这一点),该服务执行以下操作:
Can anybody point me in the right direction for how this should be done? 有人可以指出正确的方向吗? Thank you in advance for any advice.
预先感谢您的任何建议。
I dont know if I understood your question, but you can create a symple API (web service) with project ASP.NET core web aplication. 我不知道我是否理解您的问题,但是您可以使用项目ASP.NET核心Web应用程序创建一个简单的API(Web服务)。
On the Visual Studio 2017 updated - > File - > New Project - > Web - > ASP.NET core Web Aplication - > API. 在Visual Studio 2017上更新->文件->新建项目-> Web-> ASP.NET核心Web应用-> API。
If you return a serializable object, WebAPI will automatically send JSON or XML based on the Accept header that your client sends. 如果返回可序列化的对象,则WebAPI将基于客户端发送的Accept标头自动发送JSON或XML。
Create a class in the controller like this: 像这样在控制器中创建一个类:
[Route("api/Client")]
public class ClientController : Controller
{
public IActionResult Client(string name, DateTime date, int id)
{
string return1 = "return1", return2 = "return2";
return Ok(new { return1, return2});
}
}
Your client can call this class by the url www.sample.com/api/client 您的客户可以通过网址www.sample.com/api/client调用此类。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.