0

I`m trying to invoke an event using soap in UPnP. I have sniffed this command from the network and i would like to reproduce this, but i dont know where to start from + which 'framework/lib' i should use.

any suggestions to get this done in java?

this code which needs to be reproduced:

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>
Tobrun
  • 18,291
  • 10
  • 66
  • 81

1 Answers1

0

Specifically this request is an invocation of DimmableLight DCP, as i already answered you here

UPnP: intel: generate stack: java android: invoking actions on network light sample

Yes it is SOAP. While reproducing it with some generic SOAP toolset is absolutely possible, it won't get you anywhere. To actually send the request, you need to know at what socket the DimmableLight device exposes its DCP. Which means that Control Point (the origin of request which you are tediously trying to reproduce) must listen to NOTIFY packets from the UPnP network. SOAP won't help you with that.

I recommend reading UPnP-arch-DeviceArchitecture from the docs bundle mentioned by @simonc so that you know how UPnP works, before jumping onto reproducing some random sniffed packet. Then use one of the ready made libs. I can't speak for Java, but C++ Platinum is loaded with understandable examples. UPnP is just a well documented amalgamation of known and widespread technologies.

Community
  • 1
  • 1
Pavel Zdenek
  • 7,146
  • 1
  • 23
  • 38