我試圖在UPnP中使用soap調用事件。我從網絡中嗅出了這個命令,我想重現這一點,但我不知道從哪裏開始+我應該使用哪個「框架/庫」。Java:爲UPnP重新創建SOAP請求
任何建議,以在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>