Я пытаюсь выполнить призыв к действию на моем маршрутизаторе.
Вот спецификация службы:
<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>urn:schemas-wifialliance-org:device:WFADevice:1</deviceType>
<friendlyName>WFADevice</friendlyName>
<manufacturer>Broadcom Corporation</manufacturer>
<manufacturerURL>http://www.broadcom.com</manufacturerURL>
<modelDescription>Wireless Device</modelDescription>
<modelName>WPS</modelName>
<modelNumber>X1</modelNumber>
<serialNumber>0000001</serialNumber>
<UDN>uuid:9b317afe-7404-5ecd-d051-fd3d1733cbee</UDN>
<serviceList>
<service>
<serviceType>urn:schemas-wifialliance-org:service:WFAWLANConfig:1</serviceType>
<serviceId>urn:wifialliance-org:serviceId:WFAWLANConfig1</serviceId>
<SCPDURL>/x_wfawlanconfig.xml</SCPDURL>
<controlURL>/control?WFAWLANConfig</controlURL>
<eventSubURL>/event?WFAWLANConfig</eventSubURL>
</service>
</serviceList>
</device>
</root>
Одно из действий, к которым я пытаюсь сделать запрос, -звонил GetDeviceInfo
:
<action>
<name>GetDeviceInfo</name>
<argumentList>
<argument>
<name>NewDeviceInfo</name>
<direction>out</direction>
<relatedStateVariable>DeviceInfo</relatedStateVariable>
</argument>
</argumentList>
</action>
Вот как я делаю запрос:
$ curl 'http://192.168.0.1:1900/control?WFAWLANConfig' \
-X 'POST' \
-H 'Content-Type: text/xml; charset="utf-8"' \
-H 'SOAPAction: "urn:schemas-wifialliance-org:service:WFAWLANConfig:1#GetDeviceInfo"' \
-d '<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="schemas.xmlsoap.org/soap/encoding">
<s:Body>
</s:Body>
</s:Envelope>'
и я получаю:
HTTP1.1 400 Bad Request
Content-Type: text/xml
<title>400 Bad Request</title><body>400 Bad Request</body>
Можете ли вы помочь мне предоставить действительный запрос, поскольку я не очень хорошо знаком с SOAP и UPnP?