Menu

GIOP MessageError received

It_Hz
2010-12-01
2014-08-20
  • It_Hz

    It_Hz - 2010-12-01

    Hello there,

    I'm attempting to connect IIOP.Net to a Cisco DMC D9900 over it's IIOP interface. I've been going through all of the various connection attempts to the DCM, and the errors I receive in IIOP are a little difficult to interpret… I'm hoping you will be able to help.

    I have the two IDL files from the DCM IIOP, and was able to successfully convert them with your IDL compiler to a DLL.

    The namespace of the DLL created is DCM and the interface for the class that I am requesting is DeviceControl (i.e. DCM.DeviceControl)

    The error occures when the NamingContext attempts to resolve the NameComponent. In IIOPFormatter.cs:CheckAssignableRemote, on the Return statement checkDelegate(requiredTypeId);

    The error appears to be quite generic: CORBA system exception : omg.org.CORBA.COMM_FAILURE, completed: Completed_MayBe minor: 209

    Using WireShark, I can watch the TCP traffic between my machine and the DCM. The DCM is returning a generic "GIOP 1.1 MessageError"

    These are my various connection attempts…

          //System.Runtime.Remoting.Channels.
          IiopClientChannel  channelClient = new IiopClientChannel();
          ChannelServices.RegisterChannel(channelClient, false);

          // 1
          DCM.DeviceControl deviceControl = (DCM.DeviceControl)System.Runtime.Remoting.RemotingServices.Connect(typeof(DCM.DeviceControl), string.Format("iiop://{0}:{1}/DCM/DeviceControl:1:0", host, port));

          //2
          CorbaInit init = CorbaInit.GetInit();
          NamingContext nameService = init.GetNameService(host, port);
          NameComponent name  = new NameComponent {
            new NameComponent("DCM", "module"),
            new NameComponent("DeviceControl", "interface") };
          MarshalByRefObject mo = nameService.resolve(name);
          DCM.DeviceControl deviceControl = (DCM.DeviceControl)mo.CreateObjRef(typeof(DCM.DeviceControl));

          //3
          CorbaInit init = CorbaInit.GetInit();
          NamingContext nameService = init.GetNameService(host, port);
          NameComponent moduleName = new NameComponent { new NameComponent("DCM", "") };
          NamingContext nameSpace = (NamingContext)nameService.resolve(moduleName);
          NameComponent interfaceName = new NameComponent { new NameComponent("DeviceControl", "") };
          DCM.DeviceControl deviceControl = (DCM.DeviceControl)nameSpace.resolve(interfaceName);

          //4
          RmiIiopInit init = new RmiIiopInit(host, port);
          MarshalByRefObject o = init.GetService("dcm.devicecontrol");
          DCM.DeviceControl deviceControl = (DCM.DeviceControl)System.Runtime.Remoting.RemotingServices.Marshal(o); 

          //5
          RmiIiopInit init = new RmiIiopInit(host, port);
          NamingContext nameService = (NamingContext)init.GetService("DCM/DeviceControl");
          NameComponent name = new NameComponent {
          new NameComponent("dcm", ""),
          new NameComponent("deviceControl", "") };
          DCM.DeviceControl deviceControl = (DCM.DeviceControl)nameService.resolve(name);

          //6
          CORBAInitService cs = (CORBAInitService)System.Runtime.Remoting.RemotingServices.Connect(typeof(DCM.DeviceControl), string.Format("iiop://{0}:{1}/DCM", host, port));
          MarshalByRefObject mo = cs._get("devicecontrol");
          DCM.DeviceControl deviceControl = (DCM.DeviceControl)mo.CreateObjRef(typeof(DCM.DeviceControl));

          //7
          CorbaInit init = CorbaInit.GetInit();
          NamingContext nameService = init.GetNameService(host, port);
          NameComponent name  = new NameComponent {
          new NameComponent("dcm"),
          new NameComponent("devicecontrol")};
          MarshalByRefObject mo = nameService.resolve(name);
          DCM.DeviceControl deviceControl = (DCM.DeviceControl) mo.CreateObjRef(typeof(DCM.DeviceControl));

          //8
          CorbaInit init = (CorbaInit)System.Runtime.Remoting.RemotingServices.Connect(typeof(DCM.DeviceControl), string.Format("iiop://{0}:{1}/dcm/devicecontrol", host, port));
          NamingContext nameService = init.GetNameService(host, port);
          NameComponent name  = new NameComponent {
          new NameComponent("dcm"),
          new NameComponent("devicecontrol")};
          MarshalByRefObject mo = nameService.resolve(name);
          DCM.DeviceControl deviceControl = (DCM.DeviceControl) mo.CreateObjRef(typeof(DCM.DeviceControl));

     
  • It_Hz

    It_Hz - 2010-12-01

    I also just noticed that if I change the GIOPVersion to 1.1, then I receive an Exception of type 'DCM.OpNotAllowed'.

    With this code…

          IiopClientChannel  channelClient = new IiopClientChannel();
          ChannelServices.RegisterChannel(channelClient, false);

          CorbaInit init = CorbaInit.GetInit();
          NamingContext nameService = init.GetNameService(host, port, new GiopVersion(1, 1));
          NameComponent name  = new NameComponent {
          new NameComponent("DCM", ""),
          new NameComponent("DeviceControl", "") };
          DCM.DeviceControl deviceControl = (DCM.DeviceControl)nameService.resolve(name);

    SOOOOOOOOO, maybe the DCM device does not allow name service requests. Is there anyway to send IIOP commands without querying it's name service first?

     
  • It_Hz

    It_Hz - 2010-12-01

    I figured out the issue. The problem is with 3 things…

    1) connection string (specifies giop version and reference to object)
    - "corbaloc:iiop:1.1@{host}:{port}/DCM/DeviceControl"

    2) there is no NameService on the DCM

    3) there is no support for "is_a" operation. So I hardcoded CheckAssignableRemote to always return TRUE

     
  • It_Hz

    It_Hz - 2010-12-01

    In case someoen does ask for IIOP connection from C# using IIOP.Net to a Cisco DCM D9900… Here is the connection code:

    DCM.DeviceControl deviceControl = (DCM.DeviceControl)System.Runtime.Remoting.RemotingServices.Connect(typeof(DCM.DeviceControl), string.Format("corbaloc:iiop:1.1@{0}:{1}/DCM/DeviceControl", tbIPAddress.Text, tbPort.Text));

     
  • Jens Villadsen

    Jens Villadsen - 2010-12-01

    Well - initially, would you be so kind to post the IOR, the IDL's and a link to the Wireshark dump files? - And yes, it seems to me that you have already tried to query the service with IIOP without the NameService in your case 1

     
  • Jens Villadsen

    Jens Villadsen - 2010-12-01

    Yep - thats seems about right ;)

     
  • r_1504

    r_1504 - 2013-10-08

    Hi,

    I also trying to communicate with a DCM9900 server, yet I am having an issue with parsing the DCM.idl file to a .dll file using the IDLToCLSCompiler (this visual studio project was compiled using VS2012 for .NET2.0). The exception error is as follows: "Ch.Elca.Iiop.IdlPreprocessor.PreprocessingException: too much endif's encountered". Counting the number of #ifndef and #endif using Notepadd++ returning a count of 29 each (i.e.: they are equal)

    This is not the case with DCM_Types.idl, as it compiles correctly.

    Do you have any indication why this is happening?

    Regards,
    Roberto

     
  • RFuente

    RFuente - 2014-04-30

    Hi there!

    I am actually in the same situation as the previous message (r_1504). Have you happened to succeed in compiling the DCM.idl file?

     
  • Some Guy

    Some Guy - 2014-08-20

    Hi

    I'm trying to do the same thing (use IIOP.net to connect to a Cisco DCM) and struggle with the same problems.

    I managed to compile the IDL by manually removing unused sections (#ifdef, #ifndef, #else...) and by removing the parameter with a union type.

    union Scte35CommandAndData_t switch (enScte35Commands)
    {
             case eREDUS_switch:       Scte35Data_REDUS_Switch_t Data_REDUS_Switch;
             case eDCM_input_switch: Scte35Data_DCM_input_switch_t Data_DCM_input_switch;
             case eSelect_now: Scte35Data_Select_now_t Data_Select_now;
             case eNetwork_feed_active_or_inactive: Scte35Data_Network_active_t Data_Network_active;
             case eLocal_avail_enable_or_disable: Scte35Data_Local_avail_t Data_Local_avail;
             case eKeyer_on_or_off: Scte35Data_Keyer_t Data_Keyer;
             case eKeyer_config: Scte35Data_Keyer_config_t Data_Keyer_config;
             case eLogo_enable_or_disable: Scte35Data_Logo_enable_t Data_Logo_Enable;
             case eREDUS_switch_single: Scte35Data_REDUS_Switch_Single_t Data_REDUS_Switch_single;
    };
    
    typedef sequence<Scte35CommandAndData_t> Scte35CommandAndData_list_t;
    
    void Scte35CommandGetL(in IPS_Service_t SvcOut, out Scte35CommandAndData_list_t Scte35CommandAndData_list) 
            raises(TimeOut, OpNotSucceeded, OpNotAllowed, OpNotSupported);
    

    But I have not yet found how (/where) to disable the "_is_a" method.
    I have tried to modify two methods in CORBAOrbServices.cs, but that did not help.
    (I still see the call in WireShark and it still returns OpNotAllowed user exception.)
    Someone an idea?
    I have added the methods I modified, though I don't think it is much of a help.

        /// <summary>see <see cref="omg.org.CORBA.IOrbServices.is_a(object, type)"</summary>
        public bool is_a(object obj, Type type)
        {
            if (type == null)
            {
                throw new ArgumentException("type must be != null");
            }
    
            //Changed to always return true:
            return true;
            /*now unreachable code
            string repId = Repository.GetRepositoryID(type);
            return is_a(obj, repId);*/
        }
    
        /// <summary>see <see cref="omg.org.CORBA.IOrbServices.is_a(object, string)"</summary>
        public bool is_a(object obj, string repId)
        {
            if (obj == null)
            {
                throw new ArgumentException("obj must be != null");
            }
            if (repId == null)
            {
                throw new ArgumentException("repId must be != null");
            }
            if (repId.Equals("IDL:omg.org/CORBA/Object:1.0") ||
                repId.Equals(String.Empty))
            {
                // always true
                return true;
            }
    
            //Changed to always return true:
            return true;
            /*now unreachable code
            if (IsProxy(obj))
            {
                // perform remote call to check for is_a
                return IsAssignableRemote(obj, repId);
            }
            else
            {
                Type assignableTo = Repository.GetTypeForId(repId);
                // do a local check
                return Repository.IsCompatible(assignableTo,
                                               obj.GetType());
            }*/
        }
    
     
  • Carlos Eduardo

    Carlos Eduardo - 2014-08-20

    Hi, I don't think there's anyone supporting this project anymore. The OP solved this problem with the _is_a method by hardcoding a return true on IIOP.NET's CheckAssignableRemote method (class IiopClientFormatterSink, file IIOPFormatter.cs). Not a great solution but at least it seems like you'll get the compatibility you need.

    Another option would be to change the CheckAssignableRemote method to catch the specific error and return true. You would probably want to log this also, as it's a specific hack and may hide problems for you in the future. This way you also wouldn't lose the _is_a functionality with other more compatible ORBs.

     

Log in to post a comment.