【发布时间】:2021-03-02 01:37:36
【问题描述】:
知道如何使用 SoapCore 为我的呼叫添加标头吗?
到目前为止我所拥有的:
在 startup.cs:app.UseSoapEndpoint<IMyService>("/MyService.svc", new BasicHttpBinding(), SoapSerializer.DataContractSerializer);
在IMyService中
[ServiceContract]
public interface IMyService
{
[OperationContract]
public List<SOADataGetService> GetService(string ServiceType, string ServiceName, string ServiceVersion);
}
然后我的肥皂就这样结束了:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:GetService>
<tem:ServiceType>?</tem:ServiceType>
<tem:ServiceName>?</tem:ServiceName>
<tem:ServiceVersion>?</tem:ServiceVersion>
</tem:GetService>
</soapenv:Body>
</soapenv:Envelope>
我需要输入<soapenv:Header/> 之类的用户名和密码
【问题讨论】:
标签: asp.net-core soapcore