Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to AddProperty to a C# class at runtime
Message
From
01/08/2007 22:53:48
 
 
To
31/07/2007 06:11:39
General information
Forum:
ASP.NET
Category:
Web Services
Miscellaneous
Thread ID:
01243387
Message ID:
01245361
Views:
29
Hi Gary

Again I have to thank you for all the time and patience you have spent on my behalf. Thanks.

>
>I have reviewed this thread and considered your comments. I think there may be some confusion on your part regarding "XML strings" and "Objects". In an earlier message, you said something along the lines that you could send XML from VFP if you wanted to but, you had to send an "Object" that is serializable, hence the need to do this from .NET and not VFP. Am I right so far?

Yes

>
>If I am correct in my assumption, then I would point out that if you are providing a regular SOAP based XML web service for consumption by your client, then all that happens with your .NET object is that it is serialised to XML, so, if you can create XML dynamically, which you clearly can (because I have shown you how to in .NET), then you can effectively construct a .NET object in XML.

I realise that now, thanks to your efforts.

>
>So, I guess the next question is, if I was to point my browser at your web service, will it generate a WSDL for me? If so, then we are talking about a regular SOAP web service. If this is the case, then you could still use the Dictionary based approach and simply process it into an XML string that is compliant with the published SOAP schema - in otherwords, create an XML SOAP message and pass it back via the Response object in your XML web service. So, you could do this dynamically in .NET, let alone VFP.

Yup. I guess I could.

>
>On saying that, I am not sure that creating the design time classes that support the various responses required by your consumer is that much of a big deal. If you know the required permutations, then you simply design the classes around the requirements

Yes I guess I wanted too much flexibility and the ability to expand the service easily - I guess I have been spoilt with VFP all these years. Given the restrictions in .NET, I have now finally decided to create the classes individually and then fill them using COM Interop with similar classes on the VFP end. I will create the VFP classes dynamically because I can and the NET classes each individually. This will be much easier than doing the Serialization myself and more clear as to structure. I have worked out how to do this.

>
>Use a dictionary key naming conventions that group items in the dictionary into their associated classes eg., "MEMBER_Name", "Joe Bloggs"; "MEMBER_Phone", "0148 455 788", "CCInfo_CCName", "Andy Capp"; "CCInfo_CCType", "MasterCard".
>

I think I'll skip the dictionary.

>
>BTW, I used Foxpro/VFP for the longest time (along with the Codemine framework for VFP). I haven't used VFP for a few years now, just C#/.NET. When I was a boy (early 70's), I used to live in Perth WA with my parents. We emigrated to Oz in 1970 - the original £10 tourists. I had some of the happiest times I have known in WA. However, my Dad found regular and consistent work hard to come by and after three years, he brought the whole family back to the UK. Had we moved to the Eastern States, who knows, maybe I would still be there now. In the 30+ years since I came back to the UK, my Mam and Dad (now in their seventies) still have many friend in WA and have returned on many occasions every 2-4 years or so. In all that time, I have never been back since I was 11yrs old (the age I was when I left Oz back in late '72). So, it's nice to make an "Oz connection" :)
>
>I have often thought of what life would be like in Oz as a developer. Me and my Wife would both like to live/work in a warmer climate. But, I reckon I am probably a bit too old to "up sticks" (I have a 17 year old daughter and a 10 year old son). Maybe I need to be considerably older to realise this ambition when the kids don't need/don't want us any more :)
>

I knew it. You have the VFP community spirit.

You are welcome to look me up if you ever come this side. I promise you at least a drink and dinner. And you have my email as well.

Now it's on to designing the classes and learning something new - how to pass an array from VFP to .Net....

Bernard
Previous
Reply
Map
View

Click here to load this message in the networking platform