HelloWorld, add(int, int))ISWSSoapClient)(ip.addr eq 10.10.20.33 and ip.addr eq 192.168.0.100) and (tcp.port eq 1795 and tcp.port eq 8088)/WebService/IISWS.asmx (HTTP/1.1, Keep-Alive)/WebService/IISWS.asmx + SOAP Envelope (含 add 請求, a=2, b=3)<addResult>5</addResult>)
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="https://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="https://www.w3.org/2001/XMLSchema">
<soap:Body>
<add xmlns="https://tempuri.org/">
<a>2</a>
<b>3</b>
</add>
</soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope ...>
<soap:Body>
<addResponse xmlns="https://tempuri.org/">
<addResult>5</addResult>
</addResponse>
</soap:Body>
</soap:Envelope>
MF 3.0 DPWS 難用,但掌握上述封包格式後,可在裝置端:
HttpWebRequest 發送 POST,設定 Content-Type: text/xml; charset=utf-8、SOAPAction Header。XmlReader 逐節點讀取 (MF 無 XmlDocument),提取 <addResult> 文字內容。SOAPAction: "https://tempuri.org/add",缺失會導致 400/500。新專案強烈建議採用 ASP.NET Core Web API (REST/JSON) 或 gRPC (Protobuf)。SOAP/XML 僅用於維護舊系統或對接強制標準的企業總線 (ESB)。
透過 Wireshark 還原 SOAP 交互細節,是理解 WebService 底層協定、除錯跨平台互通、在受限裝置手工實作 Client 的核心技能。掌握封包結構,即掌握了互通的鑰匙。