[Openroad-users] OR App Server from within C#
Pete Rabjohns
PRabjohns at atex.com
Tue Feb 26 18:39:10 EST 2008
Thanks Neil,
I was already doing the ref Object thing already, and now that I think
about it, I'm beginning to wonder whether this is an XML serialisation
problem,
I have a class with several 'objects' as attributes, the whole class is
used as the input message for a Web Service.
Inspection of the object shows that it is an array of one entry and I am
passing this object into the SetAttribute method.
e.g.
public class Params
{
Object Param1 ;
Object param2;
Object Param3;
}
Public class WebServices : WebService
{
[WebMethod]
Public results Method1 (params in)
{
....
ParameterDataObj.DeclareAttribute ("param1","string");
ParameterDataObj.SetAttribute ("param1", in.param1); <------ This line
fails with a type conversion error
}
...
}
________________________________
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/230f261f/attachment.html
More information about the Openroad-users
mailing list