Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help with translation to Delphi

0 views
Skip to first unread message

Nick Crisp

unread,
Jul 14, 2008, 10:08:26 AM7/14/08
to
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

Craig Stuntz [TeamB]

unread,
Jul 14, 2008, 10:13:37 AM7/14/08
to
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

Craig Stuntz [TeamB]

unread,
Jul 14, 2008, 11:06:54 AM7/14/08
to
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.

Nick Crisp

unread,
Jul 14, 2008, 11:03:26 AM7/14/08
to
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

Nick Crisp

unread,
Jul 14, 2008, 11:51:24 AM7/14/08
to
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

0 new messages