Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6626647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:55:00+00:00 2026-05-25T21:55:00+00:00

I have subclassed RestDatasource to create my own data source. This is the constructor

  • 0

I have subclassed RestDatasource to create my own data source. This is the constructor to my Datasource

    public CustomDS (){
     setDataProtocol(DSProtocol.POSTMESSAGE);
     setDataFormat(DSDataFormat.XML);

     DataSourceTextField firstNameField = new DataSourceTextField("firstName", "First Name");
     DataSourceTextField lastNameField = new DataSourceTextField("lastName", "Last Name");
     DataSourceTextField userIDField = new DataSourceTextField("id", "User ID");

     setFields(firstNameField, lastNameField, userIDField);

     setXmlRecordXPath("/qm:GetResultsResponse/*");
     XmlNamespaces ns = new XmlNamespaces();
     ns.addNamespace("qm", "someurl");
     setXmlNamespaces(ns);

}

This is the xml response

 <?xml version="1.0" encoding="UTF-8"?>
 <qm:GetResultsResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xmlns:qm="someurl" xmlns:warehouse="someurl">
   <records xsi:type="warehouse:User" id="id1" firstName="fname1" lastName="Reddy">
     <voiceUserProperties languageId="en-US"/>
    </records>
   <records xsi:type="warehouse:User" id="id2" firstName="fname3" lastName="Reddy">
    <voiceUserProperties languageId="en-US"/>
   </records>
   <records xsi:type="warehouse:User" id="id3" firstName="fnam4" lastName="Reddy">
     <voiceUserProperties languageId="en-US"/>
   </records>
 </qm:GetResultsResponse>

QUESTION

In the transformResponse() method , response.getDataAsRecordList().getLength() returns 3, But i cant seem to have the records filled out with the required attributes(ie firstName, id , lastName). Does anyone see anything wrong here ?

EDIT:
As suggested i changed the datasource to extend from DataSource and not RestDataSource. I still have this problem.
If i remove xsi:type=”warehouse:User” from the XML , this works fine. Any ideas on this ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:55:00+00:00Added an answer on May 25, 2026 at 9:55 pm

    If you’re trying to parse a custom format like you’ve shown, don’t subclass RestDataSource, subclass just DataSource. RestDataSource has a lot of settings on it specific to the message format it expects, which has a lot more structure than what you’re trying to parse.

    .. now that you’re using DataSource instead – if you can, get rid of the xsi:type declarations, as they are wasted bytes. However if you grab a nightly build (from smartclient.com/builds) you will see that these declarations are now ignored when processing XML unless the type refers to a particular DataSource that you’ve declared.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have subclassed a UITableViewCell and within this class I want to get it's
I have subclassed the RadioButtonList control in order to create a Control Adapter that
I have a list view that is displaying data using the gridview. This list
I have subclassed Dialog in order to display a popup. This dialog contains a
I have subclassed UIView so I can draw some lines in it. In this
I have subclassed UIScrollView and added my own custom delegate (currently called delegate ).
I have subclassed UIView and provided my own drawRect, which works fine. However I
I have subclassed a UIImageView, and have implemented touchesBegan/Moved/Finished like this: - (void)touchesBegan:(NSSet *)touches
I have a subclassed UIViewController that's acting as an ABPeoplePicker Navigation Controller Delegate. This
I have subclassed Form to include some extra functionality, which boils down to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.