如何以soap格式调用Web服务? [英] How can invoke the web service in soap format?
问题描述
我想在调用服务后使用soap格式,
<?xml version =1.0encoding =utf-8?>
< soap:Envelope xmlns:xsi =http://www.w3.org/2001/XMLSchema-instancexmlns:xsd =http://www.w3.org/2001/XMLSchema xmlns:soap =http://schemas.xmlsoap.org/soap/envelope/>
< soap:header>
< UserNameHeader xmlns = urn:tyler:efm:services>
< username> string
< password> string
< soap:body>
< Authentication xmlns =urn:tyler:efm:services>
< ;用户名>名称
<密码>密码
我尝试了什么:
我在C#中使用Webservice [WebMethod]
I want below soap format after invoke the service,
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:header>
<UserNameHeader xmlns="urn:tyler:efm:services">
<username>string
<password>string
<soap:body>
<Authentication xmlns="urn:tyler:efm:services">
<username>Name
<password>Password
What I have tried:
I am using Webservice in C# [WebMethod]
推荐答案
请参见此处的示例: C#中的简单SOAP示例 - Salesforce Stack Exchange [ ^ ]
如果您正在寻找ASP.NET解决方案,请参阅此处的代码:< a href =https://github.com/iaincollins/mono-webservice> GitHub - iaincollins / mono-webservice:C#中的示例Web服务 - 适用于Windows,Mac和Mac上的.NET / Xamarin / Mono。 Linux。 [ ^ ]
See example here: Simple SOAP Example in C# - Salesforce Stack Exchange[^]
If you are looking for an ASP.NET solution, see code here: GitHub - iaincollins/mono-webservice: An example web service in C# - works in .NET/Xamarin/Mono on Windows, Mac & Linux.[^]
这篇关于如何以soap格式调用Web服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!