[Openroad-users] OR App Server from within C#

Pete Rabjohns PRabjohns at atex.com
Wed Feb 27 00:53:07 EST 2008


All sorted now, thanks for the input.

 

After some trial and error, I realised you had to declare all the
input/output parameters before you try to set them.

 

Regards,

 

Pete

 

________________________________

From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com] On Behalf Of
Neil.Warnock at luminary.co.uk
Sent: 25 February 2008 17:59
To: openroad-users at peerlessit.com
Subject: Re: [Openroad-users] OR App Server from within C#

 

Hi Pete, 

 

Maybe the problem is one of boxing params into objects?  See the UKIUA
site /conference/Autumn2005/NeilWarnock_1005.pdf  slide 16.

 

    ...

 

    try {

 

 /* declare params to pass */

 

        pdo.DeclareAttribute("hellostring", "STRING");
        pdo.DeclareAttribute("counter"    , "INTEGER");

 

 /* set params to pass - use object references */

 

        Object objStr = "Hello AppServer from C#!");
        pdo.SetAttribute("hellostring", ref objStr);

 

        Object objInt = 99;
        pdo.SetAttribute("counter", ref objInt);

 

 /* Make call - passing an object reference */

 

 Object objPDO = pdo;
        rso.CallProc("HelloWorld", null, ref objPDO);
        
    /* process values in the byref pdo */ 

 

        Console.WriteLine("hellostring = {0}",
pdo.GetAttribute("hellostring").ToString());
        Console.WriteLine("counter     = {0}",
pdo.GetAttribute("counter").ToString());

 

 

HTH

 

Neil Warnock

Luminary - An Ingres Company

Tel: +44 (0)845 371 4090

Mob: +44 (0)771 265 0291  

Email: Neil.Warnock at luminary.co.uk

 

For more information on Luminary go to http://www.luminary.co.uk
<http://www.luminary.co.uk/> 

Luminary Solutions Limited Registered in England No 4854134 VAT Reg No.
829 3166 13

Registered Office: Lacon House, Theobald's Road, London, WC1X 8RW

 

 

________________________________

From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Pete
Rabjohns
Sent: Monday, February 25, 2008 11:56 AM
To: International OpenROAD Users
Subject: [Openroad-users] OR App Server from within C#

Hi,

 

Anyone get any examples of calling OR4.1 App Server objects from within
c#?

 

I'm having problems getting the correct data type into the SetAttribute
method of the ParameterData object.

 

Regards,

 

Pete

 

Pete Rabjohns

Systems Architect

Atex


Email:      pete.rabjohns at atex.com 
Web:       http://www.atex.com <http://www.atex.com/> 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.peerlessit.com/pipermail/openroad-users/attachments/20080226/03f673ec/attachment-0001.html 


More information about the Openroad-users mailing list