简体   繁体   English

创建基于SOAP的Web服务,该服务存储从请求到数据库的数据

[英]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#中做到这一点),该服务执行以下操作:

  1. Listens for a SOAP request from another system that will contain the values for 3 fields (report name, run date, user ID) 侦听来自另一个系统的SOAP请求,该请求将包含3个字段的值(报告名称,运行日期,用户ID)
  2. Logs the inbound SOAP request/outbound response to a SQL database table 将入站SOAP请求/出站响应记录到SQL数据库表中
  3. Stores the 3 values sent in the inbound SOAP request to a database table 将入站SOAP请求中发送的3个值存储到数据库表中

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.

相关问题 我可以基于SOAP Web服务中的对象创建业务对象(dll)吗? - Can I create a business object (dll) based on objects from SOAP web service? 来自基于Java soap的Web服务的响应显示为null,但具有xml格式的数据 - Response from java soap based web service showing null but has data in xml format 我如何从Web服务获取肥皂请求和响应 - how do i obtain soap request and response from web service 尝试从soap服务检索数据时,HTTP请求未经授权 - HTTP request is unauthorized by trying to retrieve data from a soap service 如何创建客户端 web 服务,该服务将带有安全令牌的数据发送到另一个 soap web 服务 - How to create a client web service that send data with secure token to another soap web service in C#? 在SOAP Web服务中获取请求和响应XML - Get Request and Response XML in SOAP web service 客户端将SOAP请求发送到Web服务 - Client to send SOAP request to web service 如何在数据库中创建表,该表存储来自MS Access数据库中2个不同表的数据c#WPF中 - How to create table in database that stores data from 2 different tables in MS access Database in c# WPF 如何在Web服务中读取肥皂数据? - How to read the soap data in web service? Web服务请求调用SOAP请求缺少空参数 - web service request call SOAP request missing empty parameters
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM