getting list of devices from cucm

Version 1
    This document was generated from CDN thread

    Created by: Girisha Srinivasa on 19-11-2011 09:12:44 PM
    I am trying to get the list of devices(Phones) from cucm. facing below issue when i run class file can body help.
     below is the code snipet
    // Form the http header
    sAXLSOAPRequest = "POST https://<cucmip>:8443/realtimeservice/services/RisPort HTTP/1.1\r\n";
    //sAXLSOAPRequest = "POST /realtimeservice/services/RisPort HTTP/1.1\r\n";
    //sAXLSOAPRequest = "POST /axl/ HTTP/1.1\r\n";
    sAXLSOAPRequest += "Host:<cucmip>:8443\r\n";
    sAXLSOAPRequest += "Authorization: Basic " + authorization + "\r\n";
    sAXLSOAPRequest += "Accept: text/*\r\n";
    sAXLSOAPRequest += "Content-type: text/xml\r\n";
    sAXLSOAPRequest += "SOAPAction: \"\" ";
    sAXLSOAPRequest += "Content-length: ";
    // Build the SOAP payload
    sAXLRequest = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"\" ";
    sAXLRequest += "xmlns:xsd=\"\" xmlns:xsi=\"\" > ";
    sAXLRequest += "<SOAP-ENV:Body>";
    sAXLRequest += "<ns1:SelectCmDevice soapenv:encodingStyle=\"\" xmlns:ns1=\"\">";
    sAXLRequest += "<StateInfo xsi:type=\"xsd:string\">";
    sAXLRequest += "<CmSelectionCriteria href=\"#id0\"/>";
    sAXLRequest += "</ns1:SelectCmDevice>";
    sAXLRequest += "<multiRef id=\"id0\" soapenc:root=\"0\" soapenv:encodingStyle=\"\" xsi:type=\"ns2:CmSelectionCriteria\" xmlns:soapenc=\"\" xmlns:ns2=\"\">";
    sAXLRequest += "<MaxReturnedDevices xsi:type=\"xsd:unsignedInt\">200</MaxReturnedDevices>";
    sAXLRequest += "<Class xsi:type=\"xsd:string\">Any</Class>";
    sAXLRequest += "<Model xsi:type=\"xsd:unsignedInt\">255</Model>";
    sAXLRequest += "<Status xsi:type=\"xsd:string\">Registered</Status>";
    //sAXLRequest += "<NodeName xsi:type=\"xsd:string\">blrl86cucm39</NodeName>";
    sAXLRequest += "<NodeName xsi:type=\"xsd:string\" xsi:nil=\"true\">";
    sAXLRequest += "<SelectBy xsi:type=\"xsd:string\">Name</SelectBy>";
    sAXLRequest += "<SelectItems soapenc:arrayType=\"ns2:SelectItem[1]\" xsi:type=\"soapenc:Array\">";
    sAXLRequest += "<item href=\"#id1\"/>";
    sAXLRequest += "</SelectItems>";
    sAXLRequest += "</multiRef>";
    sAXLRequest += "<multiRef id=\"id1\" soapenc:root=\"0\" soapenv:encodingStyle=\"\" xsi:type=\"ns3:SelectItem\" xmlns:ns3=\"\" xmlns:soapenc=\"\">";
    sAXLRequest += "<Item xsi:type=\"xsd:string\">*</Item>";
    sAXLRequest += "</multiRef>";
    sAXLRequest += " </SOAP-ENV:Body> </SOAP-ENV:Envelope>";
    error i get is
    HTTP/1.1 500 Internal Server Error
    Set-Cookie: JSESSIONIDSSO=D825732FDF671BC292B5E33717AAE18D; Path=/; Secure
    Set-Cookie: JSESSIONID=31137345182B4291E0D6908E6B2D7F6A; Path=/realtimeservice; Secure
    Content-Type: text/xml;charset=utf-8
    Transfer-Encoding: chunked
    Date: Sun, 20 Nov 2011 02:55:34 GMT
    Connection: close

    <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="
    " xmlns:xsd="" xmlns:xsi=""><soapenv:Bo
     Premature end of file.</faultstring><detail><ns1:hostname xmlns:ns1="">blrl86cucm39<

    Subject: Re: New Message from Girisha Srinivasa in Administration XML (AXL) - Admini
    Replied by: Sascha Monteiro on 19-11-2011 10:02:00 PM
    You don't seem to set the content length

    Subject: RE: Re: New Message from Girisha Srinivasa in Administration XML (AXL) - Ad
    Replied by: Girisha Srinivasa on 20-11-2011 08:26:31 PM
    You don't seem to set the content length

    Thanks for your response
    I beleive this will take care of content length
    sAXLRequest += " </SOAP-ENV:Body> </SOAP-ENV:Envelope>";

    sAXLSOAPRequest += sAXLRequest.length();
    sAXLSOAPRequest += "\r\n\r\n";
    // now add the SOAP payload to the HTTPS header, which completes the AXL
    // SOAP request
    sAXLSOAPRequest += sAXLRequest;
    System.out.println("sAXLSOAPRequest  ************* "+sAXLSOAPRequest);
    or do i need to set manually? if yes what what would be.