<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<title></title>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta http-equiv="Content-Style-Type" content="text/css"/>
</head>
<body>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
Client:</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                    NamingContext nc =</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                  NamingContextHelper.narrow(orb.resolve_initial_references(</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                    "NameService"));</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                    </span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                    if(nc == null)</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                                System.out.println("nc is NULL");</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                    else</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                                System.out.println("nc is not NULL");</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                    NameComponent[] name = new NameComponent[1];</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                    name[0] = new NameComponent("Login","Object");</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                    org.omg.CORBA.Object o = nc.resolve(name);                           </span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                    CommunicationServer.Login l = LoginHelper.narrow(o);</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                    </span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                                                        if
(l != null)</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                    {</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                                System.out.println("It's working.");</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                                short ret = l.log_in(username, password);</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                                System.out.println("Retruncode: " +
ret);</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                    } else</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                                                System.out.println("Not in the naming context");</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
Server:</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
CORBA::Short Login_impl::log_in (const char * user, const char * password)</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
{</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
        std::cout << "Login_impl::log_in" << std::endl;</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
        system("touch /tmp/login_impl");</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
        CORBA::Short ret;</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
        ret = 1;</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
        return m_return; </span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
}</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
I used omniORB in the actual release version; the java client has been done with jdk 1.5.</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
The line: System.out.println("Returncode: " + ret); should print: </span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
Returncode: 1</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
but it is printing:</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Courier New" size="2">
<span style=" font-size:10pt">
Returncode: 10709</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
What am I doing wrong? Am I doing something wrong or is it an implementation problem?</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
I did a dump with Ethereal/Wireshark, but it did not work.</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<One OS to rule them all,</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
>One OS to find them,</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<One OS to bring them all</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
>and in the darkness bind them.</span></font>
</div>
</body>
</html>