Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Whats wrong with this soap?

Status
Not open for further replies.

KraftDiner

Programmer
Sep 23, 2004
3
CA
I'm sending this soap message to a UPnP IGD device and its not working.
If you need to see the xml files of this device I will try to post them somewhere.. I wish I could attach files here... :(

POST / HTTP/1.1
HOST: 192.168.2.1:80
SOAPACTION: "schemas-upnp-org:device:InternetGatewayDevice:1#GetExternalIPAddress"
CONTENT-TYPE: text/xml ; charset="utf-8"
Content-Length: 284

<?xml version="1.0"?>
<soap:Envelope xmlns:soap=" soap:encodingStyle=" <soap:Body>
  <m:GetExternalIPAddress xmlns:m= </soap:Body>
</soap:Envelope>
 
Don't know about SOAP, but this is not valid XML.
Code:
<m:GetExternalIPAddress xmlns:m=[URL unfurl="true"]http://192.168.2.1:80/control?WANIPConnection">[/URL]
should be
Code:
<m:GetExternalIPAddress xmlns:m="[URL unfurl="true"]http://192.168.2.1:80/control?WANIPConnection"/>[/URL]
 
Take a look at this. Its from Intels UPnP stack.
I'll post a message after with with quesitons about it....


This is what the device spy sent to the device to get the status of the device:

POST /_SwitchPower.0001_control HTTP/1.1
HOST: 139.48.44.44:50028
SOAPACTION: "urn:schemas-upnp-org:service:SwitchPower:1#GetStatus"
CONTENT-TYPE: text/xml ; charset="utf-8"
Content-Length: 282

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope s:encodingStyle=" xmlns:s="   <s:Body>
      <u:GetStatus xmlns:u="urn:schemas-upnp-org:service:SwitchPower:1" />
   </s:Body>
</s:Envelope>

This is the reply:

HTTP/1.1 200  OK
EXT: 
CONTENT-TYPE:  text/xml ; charset="utf-8"
SERVER:  Windows NT/5.0, UPnP/1.0, Intel CLR SDK/1.0
Content-Length: 359

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope s:encodingStyle=" xmlns:s="   <s:Body>
      <u:GetStatusResponse xmlns:u="urn:schemas-upnp-org:service:SwitchPower:1">
         <ResultStatus>0</ResultStatus>
      </u:GetStatusResponse>
   </s:Body>
</s:Envelope>


This is the device xml.

<?xml version="1.0" encoding="utf-8"?>
<scpd xmlns="urn:schemas-upnp-org:service-1-0">
   <specVersion>
      <major>1</major>
      <minor>0</minor>
   </specVersion>
   <actionList>
      <action>
         <name>GetStatus</name>
         <argumentList>
            <argument>
               <name>ResultStatus</name>
               <direction>out</direction>
               <relatedStateVariable>Status</relatedStateVariable>
            </argument>
         </argumentList>
      </action>
      <action>
         <name>SetTarget</name>
         <argumentList>
            <argument>
               <name>newTargetValue</name>
               <direction>in</direction>
               <relatedStateVariable>Target</relatedStateVariable>
            </argument>
         </argumentList>
      </action>
   </actionList>
   <serviceStateTable>
      <stateVariable sendEvents="yes">
         <name>Status</name>
         <dataType>boolean</dataType>
      </stateVariable>
      <stateVariable sendEvents="no">
         <name>Target</name>
         <dataType>boolean</dataType>
      </stateVariable>
   </serviceStateTable>
</scpd>
 
My questions are:

1) The POST Command refrences _SwitchPower.0001_control
but the name of the xml file is _SwitchPower.0001_scpd.xml
Why the difference in the two names?

2) In the rest of the soap envelope the name SwitchPower is used with.
Why this instead of _SwitchPower.0001_control or _SwitchPower.0001_scpd etc? Or doesn't any of this matter?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top