企业移动设备管理协议在 HTTP POST 请求中显示以下soap xml。如何将我的 Web 服务定义为soap 标头,以在请求和响应中包含Action、MessageID、ReplyTo 和 To 。我曾尝试在 MessageCONtract 中定义 MessageHeader,但这会导致自定义命名空间前缀。我找不到更好的文档链接。如何在客户端和 Web 服务端设置这些标头?
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"> <s:Header>
<a:Action s:mustUnderstand="1"> http://schemas.microsoft.com/windows/management/2012/01/enrollment/IDiscoveryService/Discover
</a:Action>
<a:MessageID>
urn:uuid: 748132ec-a575-4329-b01b-6171a9cf8478
</a:MessageID>
<a:ReplyTo> <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1"> https://ENROLLTEST.CONTOSO.COM/EnrollmentServer/Discovery.svc </a:To>
</s:Header>
<s:Body>
<Discover
xmlns="http://schemas.microsoft.com/windows/management/2012/01/enrollment/">
<request xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<RequestVersion>1.0</RequestVersion>
</request>
</Discover>
</s:Body>
</s:Envelope>