code: private static String getTypeNamespace(String packageName)
     {
        StringBuilder sb = new StringBuilder("http://");
  
        //Generate tokens with '.' as delimiter
        StringTokenizer st = new StringTokenizer(packageName, ".");
  
        //Have a LIFO queue for the tokens
        Stack<String> stk = new Stack<String>();
        while (st != null && st.hasMoreTokens())
        {
           stk.push(st.nextToken());
        }
  
        String next;
        while (!stk.isEmpty() && (next = stk.pop()) != null)
        {
           if (sb.toString().equals("http://") == false)
              sb.append('.');
           sb.append(next);
        }
  
        // trailing slash
        sb.append('/');
  
        return sb.toString();
     }
docs: Extracts the typeNS given the package name
  Algorithm is based on the one specified in JAXWS v2.0 spec