我正在尝试在 UPnP 中使用肥皂调用事件。我从网络上嗅到了这个命令,我想重现它,但我不知道从哪里开始 + 我应该使用哪个“框架/lib”。
有什么建议可以在java中完成吗?
此代码需要复制:
POST /_urn-upnp-org-serviceId-SwitchPower.0001_control HTTP/1.1
SOAPACTION: "urn:schemas-upnp-org:service:SwitchPower:1#SetTarget"
CONTENT-TYPE: text/xml; charset="utf-8"
HOST: 192.168.1.18:1451
Content-Length: 347
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<u:SetTarget xmlns:u="urn:schemas-upnp-org:service:SwitchPower:1">
<newTargetValue>0</newTargetValue>
</u:SetTarget>
</s:Body>
</s:Envelope>HTTP/1.1 200 OK
EXT:
CONTENT-TYPE: text/xml; charset="utf-8"
SERVER: Windows NT/5.0, UPnP/1.0
Content-Length: 290
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<u:SetTargetResponse xmlns:u="urn:schemas-upnp-org:service:SwitchPower:1" />
</s:Body>
</s:Envelope>