[omniORB] Attribute Error In IDL Generated Module

jiwils - Jimmy Wilson jiwils@acxiom.com
Sat, 17 Mar 2001 23:00:30 -0600


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C0AF68.5B13D5A0
Content-Type: text/plain;
	charset="iso-8859-1"

When importing the Test module below, I get an attribute error.  The
attribute error's location is the module generated by omniidl for Test.IDL.
I think that the problem might have something to do with the fact that I
have objects declared in my interface module space, but I would like to
confirm that what I am seeing is truly a problem.  Since omniORBpy 1.2 has a
problem with objects in interface module spaces, I've upgraded to omniORBpy
1.3 without success.  If this is a true problem, is there an appropriate
workaround?  Would moving the IDL objects outside of the interface module
space be an appropriate fix?  I've attached the files mentioned above as
well as the attribute error I am getting.  Any help will be greatly
appreciated.

Jimmy
-- 
James "Jimmy" Wilson
Software Developer, Acxiom Corporation

 <<Test.py>>  <<Test.IDL>>  <<Test.error.txt>> 

------_=_NextPart_000_01C0AF68.5B13D5A0
Content-Type: application/octet-stream;
	name="Test.py"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="Test.py"

import string
import sys
import omniORB
import CORBA
import _GlobalIDL

class TestService:
	__ORB =3D None
	__GenericTestServiceFactoryURI =3D =
"corbaloc:iiop:%host%:%port%/:%5c%host%:KeyAppendFactory:%marker%::IFR:K=
eyAppendFactory%00"
	__TestServiceFactory =3D None
	__TestService =3D None
	__ErrorFlag =3D 0
	__ErrorDescription =3D None
=09
	def __init__(self, Host, Port, Marker =3D "0"):

		# Create the specific factory URI.
		URI =3D string.replace(__GenericTestServiceFactoryURI, "%host%", =
Host)
		URI =3D string.replace(URI, "%port%", 1570)
		URI =3D string.replace(URI, "%marker%", Marker)
	=09
		# Initialize the ORB.
		self.__ORB =3D CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
	=09
		# Turn the URI into an IOR.
		IOR =3D self.__ORB.string_to_object(URI)
	=09
		# Establish the connection to the remote factory object.
		try:
			self.__TestServiceFactory =3D =
IOR._narrow(_GlobalIDL.TestServiceFactory)
	=09
		except:
			self.__ErrorFlag =3D 1
			self.__ErrorDescription =3D "An unknown exception occurred while =
connecting to the remote KeyAppendFactory\r\nobject on %s:%s.  The =
marker used was %s.  Most likely, a\r\nconnection can not be =
established." % (Host, Port, Marker)
			return
		=09
		del URI		=09
		del IOR
	=09
		# Create a server implementation object and connect to it.
		try:
			TestServiceOBJ =3D self.__TestServiceFactory.oNewTestService()
			self.__TestService =3D =
TestServiceOBJ._narrow(_GlobalIDL.TestService)
	=09
		except:
			self.__ErrorFlag =3D 1
			self.__ErrorDescription =3D "An unknown exception occurred while =
creating a remote KeyAppend object.  The\r\nremote KeyAppend object was =
created on %s." % (Host)
			return
------_=_NextPart_000_01C0AF68.5B13D5A0
Content-Type: application/octet-stream;
	name="Test.IDL"
Content-Disposition: attachment;
	filename="Test.IDL"

interface TestService
{
  typedef struct TestService_input_struct
  {
    char CharacterBuffer[10];
  }TEST_SERVICE_INPUT_STRUCT;


  typedef struct TestService_output_struct
  {
    char Return_Code;
  }TEST_SERVICE_OUTPUT_STRUCT;

  
  typedef struct TestServuce_Input_Array_Struct
  {
    TEST_SERVICE_INPUT_STRUCT InputArray[35];

    short NumberOfRecordsSent;
  }TEST_SERVICE_INPUT_ARRAY_STRUCT;


  typedef struct TestService_Output_Array_Struct
  {
    TEST_SERVICE_OUTPUT_STRUCT OutputArray[35];
  }TEST_SERVICE_OUTPUT_ARRAY_STRUCT;


  // Version 3.0/3.0.1 call.
  long DoThis(in TEST_SERVICE_INPUT_ARRAY_STRUCT InputArrayStruct,
              out TEST_SERVICE_OUTPUT_ARRAY_STRUCT OutputArrayStruct);
};

interface TestServiceFactory
{
  TestService oNewTestService();
  void        vFreeTestService(in TestService TSObject);
};
------_=_NextPart_000_01C0AF68.5B13D5A0
Content-Type: text/plain;
	name="Test.error.txt"
Content-Disposition: attachment;
	filename="Test.error.txt"

Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import Test
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "Test.py", line 5, in ?
    import _GlobalIDL
  File "_GlobalIDL\__init__.py", line 6, in ?
    import Test_IDL
  File "Test_IDL.py", line 20, in ?
    class TestService :
  File "Test_IDL.py", line 41, in TestService
    class TEST_SERVICE_INPUT_STRUCT (_0__GlobalIDL.TestService.TestService_input
_struct):
AttributeError: TestService
>>>
------_=_NextPart_000_01C0AF68.5B13D5A0--