Using SOAP CommandsThe Simple Object Access Protocol (SOAP) is the vehicle that is used to deliver XML queries and send responses. SOAP allows for remote procedure calls to be executed via HTTP using XML to encode the method call and parameters. The SOAP request consists of a SOAP Envelope element that contains an optional Header element and a Body element. The payload of the SOAP request is contained in the Body element. The payload is the method call and parameters encoded in XML. The ExecuteXMLCommand method takes one parameter called eRoomXML. This parameter is the XML query. The method returns an XML response. An example of the SOAP request would be: <?xml version="1.0" encoding="UTF-8" ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <er:ExecuteXMLCommand xmlns:er="http://www/eRoom.com/eRoomXML/2003/700"> <er:eRoomXML> <er:command er:select="Rooms"> <er:getproperties> <er:URLName/> <er:ID/> </er:getproperties> </er:command> </er:eRoomXML> </er:ExecuteXMLCommand> </SOAP-ENV:Body> </SOAP-ENV:Envelope> The following request has no headers in the SOAP Envelope, and the Body contains the ExecuteXMLCommand method call. If the URL target is the facility, this request will get the URLName and ID for every room. The response contains a single value called eRoomXML and looks like this: <SOAP-ENV:Envelope> <SOAP-ENV:Body> <er:ExecuteXMLCommandResponse xmlns:er="http://www/eRoom.com/eRoomXML/2003/700"> <er:eRoomXML> <er:response> <er:status> <er:code>0x00000000</code> <er:description>Success</description> <er:/status> <er:Rooms> <er:Room> <URLName>myroom</URLName> <ID>D6BC315E-670D-11D4-A925-00105AAA1FFC</ID> <er:/Room> <er:/Rooms> <er:/response> <er:/eRoomXML> <er:/ExecuteXMLCommandResponse> </SOAP-ENV:/Body> </SOAP-ENV:/Envelope> |