🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.language.delphi.dotnet
5 messages
5 total messages Started by Nick Crisp Mon, 14 Jul 2008 14:08
Help with translation to Delphi
#99
Author: Nick Crisp
Date: Mon, 14 Jul 2008 14:08
12 lines
1188 bytes
Hi

Any idea what the delphi equivilant of this is?

public Object[] WebServiceMethodName(object context)
   {
       IDictionary<string, object> contextDictionary = (IDictionary<string, 
object>)context;

Many thanks

Nick 
Re: Help with translation to Delphi
#100
Author: Craig Stuntz TeamB
Date: Mon, 14 Jul 2008 14:13
13 lines
1486 bytes
Nick Crisp wrote:

> Any idea what the delphi equivilant of this is?
> 
> public Object[] WebServiceMethodName(object context)

	Are you consuming a web service?

-- 
Craig Stuntz [TeamB] � Vertex Systems Corp. � Columbus, OH
  Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Want to help make Delphi and InterBase better?  Use QC!
  http://qc.borland.com -- Vote for important issues
Re: Help with translation to Delphi
#152
Author: Nick Crisp
Date: Mon, 14 Jul 2008 15:03
31 lines
1986 bytes
Hi Craig

> Are you consuming a web service?

No - trying to write a webservice that meets a certain format.

Heres the C# webservice I'm trying to copy.

   [WebMethod]
   public RadComboBoxItemData[] WebServiceMethodName(object context)
   {
       IDictionary<string, object> contextDictionary = (IDictionary<string, 
object>)context;
       List<RadComboBoxItemData> result = new List<RadComboBoxItemData>(1);
       RadComboBoxItemData itemData = new RadComboBoxItemData();
       itemData.Text = contextDictionary["FilterString"].ToString();
       itemData.Value = contextDictionary["FilterString"].ToString();
       result.Add(itemData);
   }

I've created a type ComboBoxItems = array of RadComboBoxItem for my return 
type.

I just need to translate

       IDictionary<string, object> contextDictionary = (IDictionary<string, 
object>)context;

Thanks

Nick 
Re: Help with translation to Delphi
#151
Author: Craig Stuntz TeamB
Date: Mon, 14 Jul 2008 15:06
12 lines
1575 bytes
Nick Crisp wrote:

> Heres the C# webservice I'm trying to copy.

	Do you have WSDL for that?  Consume the WSDL and see what types Delphi
spits out.

-- 
Craig Stuntz [TeamB] � Vertex Systems Corp. � Columbus, OH
  Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Want to help make Delphi and InterBase better?  Use QC!
  http://qc.borland.com -- Vote for important issues
Re: Help with translation to Delphi
#153
Author: Nick Crisp
Date: Mon, 14 Jul 2008 15:51
24 lines
1570 bytes
Hi Craig

I've found the answer.

I was trying to translate

 IDictionary<string, object> contextDictionary = (IDictionary<string,
object>)context;

as

var
  contextDictionary: IDictionary<string, system.&object>;
begin
 contextDictionary := Context as IDictionary<string, system.&Object>;

This gave errors at various points until I added system.collections.generics 
to the uses clause.

Now works ok.

Many thanks

Nick 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads