Search code examples
javaiphonemobile-safarimdm

iOS MDM Enrollment


I am on the phase of developing a Apple MDM server for iOS devices. my checkin URL is https:\anand-2255\checkin...

I am building the server with Tomcat, my Servlet-maping and servlet is as follows

<servlet-mapping>
    <servlet-name>MDM</servlet-name>
    <url-pattern>/checkin</url-pattern>
</servlet-mapping>
<servlet>
    <servlet-name>MDM</servlet-name>
    <servlet-class>com.manageengine.ads.fw.servlet.Mdm</servlet-class>
</servlet>

Mdm class is as follows. It just gets the Get and post request and prints in log.

public class Mdm extends HttpServlet
{
    private static Logger out = Logger.getLogger("ADSLogger");

    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {
        String in = request.getQueryString().toString();
        System.out.println("MDM-Servlet-Clas-POST");
        System.out.println(in);
    }
        public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {
        String in = request.getQueryString().toString();
        System.out.println("MDM-Servlet-Clas-GET");
        System.out.println(in);
    }
}

When I give a url like https:\anand-2255\checkin?hello, I can see hello in my log through GET request. But when I try to enroll the device from iPhone Configuration Utility, the device is not sending any POST request to this url. It says "Profile Installation Failed" and console says "A connection to the server could not be established".


Solution

  • doPost should not be used. doPut should be used since the iOS sends the message as plist file.