1 Reply Latest reply on Sep 21, 2010 9:10 AM by jfb00

    XMLLIST Which is similar to .Net

    flexbondili

      Hi,

       

        I am converting Flex code to Vb.Net. I am struck up at point.

       

      My Flex Code is,

       

      public

       

       

       

       

       

      function get_upholstery_items():void {

      PopUpManager.removePopUp(model.pop_up);

       

       

      if (model.prevue_session_id.length > 0) {

      app_commander.trace_log(

      "get_upholstery_items", "GetItems");

       

      var ws : WebService = new mx.rpc.soap.WebService();

       

      ws.loadWSDL(model_locator.APPLICATION_PREVUE_WEB_SERVICE_URL);

      ws.makeObjectsBindable =

      false;

      ws.useProxy =

      false;

       

      ws.GetItems.resultFormat =

      "e4x";

      ws.GetItems.addEventListener(ResultEvent.RESULT, get_items_result);

      ws.GetItems.addEventListener(FaultEvent.FAULT, app_commander.web_service_fault);

      ws.GetItems.arguments.sessionKey = model.prevue_session_id;

      ws.GetItems();

       

      app_commander.trace_log(

      "get_upholstery_items", model_locator.APPLICATION_PREVUE_WEB_SERVICE_URL + "?sessionKey=" + ws.GetItems.arguments.sessionKey);

      }

      }

       

       

      private function get_items_result(event:*=null):void {

       

      var eprevue:Namespace = new Namespace("http://www.eprevue.net/EasyOrderService");

       

      //var xml_items : XMLList = XML(event.result).child(0).children();

       

       

      var xml_items : XMLList = XML(event.result).eprevue::GetItemsResult.eprevue::WSOrderItem;

       

      var xml_item_count : int = xml_items.length();

       

      var cur_xml_item : int = 0;

       

      app_commander.trace_log(

      "get_items_result", xml_items.toString());

      app_commander.trace_log(

      "get_items_count", xml_item_count.toString());

       

       

      for each(var xml_item:XML in xml_items) {

       

      //Alert.show(String(xml_item).substr(0,999));

       

       

      var xml_parts : XMLList = xml_item.eprevue::Parts.eprevue::WSComponentPart;

      cur_xml_item++;

       

      ----------------------------------------------

      in the above code they are calling a webservice. That webservice result they are appending to a XMLLIST, as

       

      var xml_items : XMLList = XML(event.result).eprevue::GetItemsResult.eprevue::WSOrderItem;

       

      How can I convert that Part of the Code to Vb.net. Can any one help me.

       

      http://ep5.eprevue.net/eprevuebroyhill/WebServices/EasyOrder/EasyOrderService.asmx-------------this the Webservice link which Iam going through. In that GetItems is the webservice name.

       

      While debugging flex code I got the ouput for this line is var xml_items : XMLList = XML(event.result).eprevue::GetItemsResult.eprevue::WSOrderItem; as follows.

       


      <WSOrderItem xmlns="http://www.eprevue.net/EasyOrderService" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <OrderItemIdx>
          0
        </OrderItemIdx>
        <BaseComponentID>
          2240957
        </BaseComponentID>
        <BaseComponentSku>
          1004-254
        </BaseComponentSku>
        <ConfiguredComponentSKU>
          1004-254
        </ConfiguredComponentSKU>
        <Quantity>
          1
        </Quantity>
        <Price>
          290
        </Price>
        <AreaCount>
          1
        </AreaCount>
        <IsValid>
          true
        </IsValid>
        <AreaFabrics>
          <int>
            2240904
          </int>
        </AreaFabrics>
        <Parts>
          <WSComponentPart>
            <AreaName>
              BODY
            </AreaName>
            <PartRoleType>
              cover
            </PartRoleType>
            <Name>
              7047-91
            </Name>
            <SellerSku/>
            <AreaCode/>
            <Quantity>
              1
            </Quantity>
            <MaterialQuantity>
              3.01349974
            </MaterialQuantity>
            <MaterialUnit>
              yd
            </MaterialUnit>
            <Grade>
              E
            </Grade>
            <Price>
              290
            </Price>
            <Sequence>
              1
            </Sequence>
          </WSComponentPart>
        </Parts>
      </WSOrderItem>

       

      Could any one help me to convert that part of the code to Vb.net.

       

      Thanks! in Advance