This is a migrated thread and some comments may be shown as answers.

Basic Services Question :)

3 Answers 78 Views
Web Services
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 01 Sep 2010, 07:00 PM
I want to have a service that generates me a list of Products into XML which I can consume clientside

So how exactly does this work?  Like I don't want ALL products, just 5 specific ones for example....but the product IDs are all Guids so the querystring could potentially be larger than the max length...So I give the user a checkbox list to pick what they want, then the user control calls the service passing in IDs or something?

Am I even barking up the right tree here?

Steve

3 Answers, 1 is accepted

Sort by
0
Petko_I
Telerik team
answered on 07 Sep 2010, 07:36 AM
Hello Steve,

As far as I understand you want to serialize the OpenAccess persistent objects into XML. You want to have an XML representation on the client side. There is no automatic way to do this by using OpenAccess. You should implement custom logic to make the transformation or customize your WCF service with an XmlSerializer and try to capture the generated XML.
There are two options which you have in order to proceed with the service implementation.
- Transform objects into XML explicitly and send their string representation for example.
- Use data transfer objects and plain WCF services which is what I recommend. We have updated our knowledge base repository with an article which can help you automate the generation and management of the transport objects. These special objects are needed as OpenAccess persistent objects cannot be sent directly with service methods. By creating your own service you will have much more control over its definition and thus proceed with customization smoothly. For instance, here you can implement filter methods which receive the string representations of the GUIDs in a list and return the appropriate objects.
The topic you have raised is an interesting one and is something that is not commonly seen these days – especially when much of the serialization is left to the WCF service. Please, do not hesitate to elaborate on the scenario you wish to accomplish so that we can continue the discussion and clarify the misunderstandings. I would be glad to know if I am guiding you in the right direction.


All the best,
Petko_I
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 07 Sep 2010, 01:31 PM
Hey Petko,
  Thanks for the detailed response :)

I was thinking of the wizard becasue I thought I remembered seeing videos by Forte and others taking Northwind and turning them into a service with data queryable by url... (REST?)

I'll have a go with the DTOs, thanks!
0
Petko_I
Telerik team
answered on 09 Sep 2010, 09:25 PM
Hi Steve,

I suggested using plain WCF services because this way you can concentrate only on the basic functionality you need to expose. The Data Services Wizard, however, can speed up the process of creating WCF services for the basic CRUD operations. And of course, you can always add your own service methods. I suppose you are familiar with the OpenAccess help sections of the Data Service Wizard. Here is an entry link just in case. And yes, you are right – we conform to the REST architectural style.


Sincerely yours,

Petko_I
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Web Services
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Petko_I
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or