Collections in a Web Service

Hi, I am using ORM classes code from a web service, and I have a problem with the collections because they are not public attributes. These classes can´t publish in the web service because are not standard.
How can I solve this problem?

Hello Eduardo,

Thank you for your post. Could you let me know more about your standard? As I know we seldom use public attributes. Instead, we would make attributes as private, and let the accessors to be public.

Best regards,
Jick

Ok Jick. You are right. I want to serialize the collections that visual paradigm generates to can use it in a web service.
A collection like “ArrayList” have not problems to be serializable in a SOAP message.

Thanks.


Dibujo.jpg

Hello Eduardo,

I will discuss with our engineers and come back to you asap.

Best regards,
Jick

Hello Eduardo,

We would like to clarify your need first. May I know how does the currently generated code looks like, and what would be your expected result? Could you provide us with some code sample to illustrate your need?

To be specific, do you want to change only the collection to public? We suppose it should work with property, but we are not sure…

Best regards,
Jick

Hello Jick.
It´s easy. You can try to return an ORM class with an 0…* association to another ORM class from a Web Service and the Web Service will throw a System.InvalidOperationException.

Hi Eduardo,

Thank you for your reply. So do you want not only public attributes, but also a collection that is compatible with webservice?

Best regards,
Jick

Hi Jick,
You can forget my previous posts.
I think that my problem is the serialization of the ORM objects. An ORM object can´t be serializabled in a XML file or SOAP message. We can see the problem from this point of view.
Thank you Jick.

This forum is very useful. :wink:

Best regards.

(Sorry but I can´t get an english version of Visual Studio 2005)

Hello Eduardo,

Thanks for your reply. I discussed with our engineers. Actually, the problem is not related to “public” or not, but about serialization - The collection used by NHibernate can’t be serialized. A related discussion:
http://forum.hibernate.org/viewtopic.php?t=956359&view=previous&sid=92939d20c6a0a46099b92e24af31a14c

Best regards,
Jick

Ok Jick!
Thanks for the link. I´m going to apply that pattern to solve my problem.

:thumbup: