C# 使用SOAP形式thisInvokeProgram_Download_ADD new object item_number workstation product_model
在C#中,要使用SOAP形式发送参数到指定IP,可以使用System.Net.WebServices命名空间中的SoapHttpClientProtocol类。
首先,创建一个继承自SoapHttpClientProtocol类的子类,用于定义SOAP请求的目标方法。在子类中创建一个名为ProgramDownloadService的类,并在该类中定义目标方法Program_Download_ADD。
using System.Net;
using System.Net.WebSockets;
public class ProgramDownloadService : SoapHttpClientProtocol
{
public ProgramDownloadService(string url)
{
this.Url = url;
}
public void Program_Download_ADD(string item_number, string workstation, string product_model, string specific_name, string worktable)
{
this.Invoke("Program_Download_ADD", new object[] { item_number, workstation, product_model, specific_name, worktable });
}
}
然后,创建一个实例并调用Program_Download_ADD方法来发送参数到指定IP。假设目标IP地址为192.168.1.100,SOAP服务的URL为http://192.168.1.100/program_download_service。
string targetUrl = "http://192.168.1.100/program_download_service";
ProgramDownloadService service = new ProgramDownloadService(targetUrl);
service.Program_Download_ADD(item_number, workstation, product_model, specific_name, worktable);
请确保替换item_number、workstation、product_model、specific_name和worktable为实际的参数值,并将targetUrl替换为目标IP的正确URL
原文地址: http://www.cveoy.top/t/topic/iDeh 著作权归作者所有。请勿转载和采集!