Mobile Workflow DCN Request using HTTP Authentication

If you do not want to use URL parameters to send login and password information, you can send the information to the HTTP server as part of the HTTP request header.

The DCN request messages can also be sent as HTTP POST data. The URL of an HTTP authentication Mobile Workflow DCN request is:

http://host:8000/dcn/HttpAuthDCNServlet?cmd=wf&security=admin&domain=default&dcn_filter=aa.bb
[post data]

The [post data] is the content of the Mobile Workflow request.

Example 1

Mobile Workflow DCN request using HTTP authentication:
URL url = new URL("http://<host>:8000/dcn/HttpAuthDCNServlet?cmd=wf&security=default");
        HttpURLConnection huc = (HttpURLConnection) url.openConnection();
        huc.setDoOutput(true);
        huc.setRequestMethod("POST");
        final String login = "supAdmin";
        final String pwd = "s3pAdmin";
        Authenticator.setDefault(new Authenticator()
        {
            protected PasswordAuthentication getPasswordAuthentication()
            {
                return new PasswordAuthentication(login, pwd.toCharArray());
            }
        });
        
        StringBuffer sb = new StringBuffer();
        sb.append(wfdcn_request);
        OutputStream os = huc.getOutputStream();
        os.write(sb.toString().getBytes());
        os.close();