3.2.4.2 Setting Presence for Self User (setPresence SERVICE Request)

The client uses a SOAP request, carried in the body of a SERVICE request, to set or update its own presence information. This is done at least once (during login) and whenever the presence state of the user changes. The setPresence SOAP request is the trigger for the server to generate NOTIFY requests to the watchers of this user. An example setPresence request looks like the following.

 SERVICE sip:user@tradewind.com 
 SIP/2.0 Via: SIP/2.0/TLS 157.56.65.142:3485 Max-Forwards: 70 
 From: "Bob" <sip:user@tradewind.com >;
    tag=263b894bb94d444b801fc070cd8c403a;
    epid=a892397901 
 To: < sip:user@tradewind.com > 
 Call-ID: 157892a29f7e44199693e2a1e48fdd98 
 CSeq: 3 SERVICE 
 Contact:
    < sip:user@tradewind.com:3485;
      maddr=157.56.65.142;
      transport=tls>;
      proxy=replace 
 User-Agent: 
    RTC/1.3.5315 (Messenger 5.1.0530)
 Proxy-Authorization: 
    NTLM qop="auth", 
    realm="SIP Communications Service", 
    opaque="bfaf9a7c",  
    crand="84e2891d",  
    cnum="8",  
    targetname="tradewind.com",  
    response="0100000038393462892479edd2994f63"
 Content-Type: application/SOAP+xml
 Content-Length: 
  
 <SOAP-ENV:Envelope 
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
       <m:setPresence xmlns:m="http://schemas.microsoft.com/winrtc/2002/11/sip">
       <m:presentity m:uri="sip:sip:user@tradewind.com">
       <m:availability m:aggregate="300" m:description="online"/>
       <m:activity m:aggregate="400" m:description="Active"/>
       <deviceName 
          xmlns="http://schemas.microsoft.com/2002/09/sip/client/presence" 
          name="USER-DESKTOP"/>
       <rtc:devicedata 
          xmlns:rtc="http://schemas.microsoft.com/2002/09/sip/client/presence" 
          namespace="rtcService">
          &lt;![CDATA[
           <caps>
            <renders_gif/>
            <renders_isf/>
           </caps>]]&gt;
       </rtc:devicedata>
       </m:presentity>
       </m:setPresence>
    </SOAP-ENV:Body>
 </SOAP-ENV:Envelope>

The SERVICE method is used to carry a variety of SOAP requests between the client and the server. The body of the request identifies the specific SOAP method that is being invoked. In this case, the "m:setPresence" string indicates that this is a setPresence request. The uri attribute on the presentity element indicates the user whose presence is being set and MUST match the To and From header URIs. The remaining content of the setPresence body is a text/xml+msrtc.pidf Presence Document. Note the namespace of the XML document that MUST match exactly for the server to recognize this SOAP request.