Basic Services Question :)

4 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 01 Sep 2010 Link to this post

    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
  2. Petko_I
    Admin
    Petko_I avatar
    184 posts

    Posted 07 Sep 2010 Link to this post

    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
  3. DevCraft banner
  4. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 07 Sep 2010 Link to this post

    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!
  5. Petko_I
    Admin
    Petko_I avatar
    184 posts

    Posted 09 Sep 2010 Link to this post

    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
Back to Top