Re: CosNaming



Hi,

Even I had the same problem. I had sent a patch for this problem & found
that the problem is solved. I'm not very sure whether this is the right
way of solving the problem & whether any other patch is available. However
I did not encounter any other problems after applying this.

Sreeji

On Wed, 30 May 2001, Adam Cassar wrote:
> Hi Guys,
> I have been attempting to get the ORbit bindings to work with perl...
> Essentially I do something simmilar to the below:
> 
> use CORBA::ORBit idl => [ qw(blah.idl CosNaming.idl) ];
> 
> my $orb = CORBA::ORB_init("orbit-local-orb");
> $poa = $orb->resolve_initial_references("RootPOA");
> 
> my $servant = new blah;
> 
> my $id = $poa->activate_object($servant);
> 
> my $ns = $orb->resolve_initial_references("NameService");
> 
> my $nc_root = [ { id => 'blah1', kind => '' } ];
> my $nc_leaf = [ { id => 'blah1', kind => '' }, { id => 'blah2', kind => '' } ];
> 
> $ns->bind_new_context( $nc_root );
> $ns->rebind( $nc_leaf, $servant);
> 
> Running this gives an error on the above line saying that the object was unknown and could not be martialed. Am I missing something obvious?
> 
> TIA
> 
> _______________________________________________
> orbit-perl-list mailing list
> orbit-perl-list gnome org
> http://mail.gnome.org/mailman/listinfo/orbit-perl-list
> 

--- CORBA-ORBit-0.4.3/marshal.c	Thu Mar 22 12:35:46 2001
+++ CORBA-ORBit-0.4.3/marshal.new.c	Thu Mar 22 12:34:38 2001
@@ -414,27 +414,45 @@
 put_objref (GIOPSendBuffer *buf, CORBA_TypeCode tc, SV *sv)
 {
     CORBA_Object obj;
-    PORBitIfaceInfo *info = porbit_find_interface_description (tc->repo_id);
+    PORBitIfaceInfo *info;
 
-    if (!info)
-	croak ("Attempt to marshall unknown object type");
-    
-    if (!SvOK(sv))
-	obj = CORBA_OBJECT_NIL;
-    else {
-	/* FIXME: This check isn't right at all if the object
-	 * is of an unknown type. (Or if the type we have
-	 * for the object is not the most derived type.)
-	 * We should call the server side ISA and then
-	 * downcast in this case?
-	 */
-	if (!sv_derived_from (sv, info->pkg)) {
-	    warn ("Value is not a %s", info->pkg);
-	    return CORBA_FALSE;
-	}
+		if (tc->repo_id[0] != NULL)
+		{
+			info = porbit_find_interface_description (tc->repo_id);
 
-	obj = (CORBA_Object)SvIV((SV*)SvRV(sv));
-    }
+			if (!info)
+				croak ("Attempt to marshall unknown object type");
+    
+			if (!SvOK(sv))
+		obj = CORBA_OBJECT_NIL;
+			else {
+		/* FIXME: This check isn't right at all if the object
+		 * is of an unknown type. (Or if the type we have
+		 * for the object is not the most derived type.)
+		 * We should call the server side ISA and then
+		 * downcast in this case?
+		 */
+		if (!sv_derived_from (sv, info->pkg)) {
+				warn ("Value is not a %s", info->pkg);
+				return CORBA_FALSE;
+		}
+
+		obj = (CORBA_Object)SvIV((SV*)SvRV(sv));
+			}
+		}
+		else
+		{
+			/* We simply check whether SV is an object. Is that right ? - Sreeji */
+			if (!SvOK(sv))
+		obj = CORBA_OBJECT_NIL;
+			else {
+				if (!sv_isobject (sv)) {
+						warn ("Value is not an Object Reference");
+						return CORBA_FALSE;
+				}
+				obj = (CORBA_Object)SvIV((SV*)SvRV(sv));
+			}
+		}
     
     ORBit_marshal_object (buf, obj);
     return CORBA_TRUE;
@@ -702,3 +720,4 @@
 	return CORBA_FALSE;
     }
 }
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]