Results 1 to 1 of 1

Thread: Parsing XML data with multiple elements from asp.net web service

  1. #1
    Sencha User
    Join Date
    Mar 2011
    Location
    Knoxville, TN
    Posts
    1

    Question Parsing XML data with multiple elements from asp.net web service

    Hello,

    I have recently started using ExtJS and have come across few doubts which could not be cleared with the documentation or the forums. Maybe I am getting it all wrong but I would appreciate if someone could shed some light here.

    I am trying to call a .asmx (.net) webservice which has xml schema as follow:

    Code:
    <xs:schema id="myDataSet">
    ?
    <xs:element name="myDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
    ?
    <xs:complexType>
    ?
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    ?
    <xs:element name="solutionCost">
    ?
    <xs:complexType>
    ?
    <xs:sequence>
    <xs:element name="Cost_x0020_Type" type="xs:string" minOccurs="0"/>
    <xs:element name="Total_x0020_Cost" type="xs:double" minOccurs="0"/>
    <xs:element name="Cost_x0020_per_x0020_Gallon" type="xs:double" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    ?
    <xs:element name="solutionRefinery">
    ?
    <xs:complexType>
    ?
    <xs:sequence>
    <xs:element name="Refinery_x0020_ID" type="xs:int" minOccurs="0"/>
    <xs:element name="Refinery_x0020_Type_x0020_ID" type="xs:int" minOccurs="0"/>
    <xs:element name="Tons_x0020_Processed" type="xs:double" minOccurs="0"/>
    <xs:element name="Gallons_x0020_Produced" type="xs:double" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    ?
    <xs:element name="solutionTerminal">
    ?
    <xs:complexType>
    ?
    <xs:sequence>
    <xs:element name="Terminal_x0020_ID" type="xs:int" minOccurs="0"/>
    <xs:element name="Name" type="xs:string" minOccurs="0"/>
    <xs:element name="Gallons_x0020_Processed" type="xs:double" minOccurs="0"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:choice>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    My questions are:

    1) To fetch the xml data from these elements, do I need to write multiple xmlreader calls? For eg. one call each for the solutionCost, solutionRefinery and solutionTerminal elements? Is there a way to read multiple elements from xml schema within the same call?
    2) I also need to include authentication header with my request, will that go in params within the Store object?
    3) The webservice on asp.net only talks on XML/SOAP, and does not return JSON data. Is there a way to enable that?

    I would appreciate any suggestions/advice in helping me nailing this down.

    Thanks,

    Bhuvanesh
    Last edited by btomar; 11 Mar 2011 at 7:56 AM. Reason: format code to dispplay properly

Similar Threads

  1. XML Parsing: Multiple text elements with the same tag name
    By chu_man_fu in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 15 Sep 2011, 5:17 AM
  2. WCF Data Service
    By IsmajlMaliqi in forum Community Discussion
    Replies: 0
    Last Post: 21 Jan 2011, 7:33 AM
  3. Problem with web service data in iPhone
    By NitrOuS in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 15 Dec 2010, 6:27 AM
  4. JsonReader data parsing
    By vicentiu in forum Ext 3.x: Help & Discussion
    Replies: 6
    Last Post: 7 Aug 2010, 6:30 AM
  5. Possible to share a service as multiple data sources?
    By rlieving in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 6 Feb 2008, 10:26 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •