Unable to get values after XML deserialization

Hello All,

I’m working on a API POC, After successfully posting the data using HTTP request. I want to save few values from the output of HTTP request.
Hence I’m using deserialize XML activity to get the individual values of the Response. However I’m getting an error which says Assign: The “:” Character, hexadecimal value 0x3A cannot be included in a name. Can anyone please help me resolve this issue. I’m attaching screenshot for reference

Have a look below where the handling of XML Namespaces is introduced:

Hi Peter,

I have created two variables of type Xnamespace.


And I’m passing the Xnamespace variables as shown in the below image

However I’m getting Object reference not set to an instance of an object error now.

I can post the XML in the comments if required.

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CalculateTransactionTotals xmlns="http://schemas.micros.com/RESPOS">
      <ppMenuItems>
        <ResPosAPI_MenuItem>
          <MenuItem>
            <MiObjectNum>int</MiObjectNum>
            <MiMenuLevel>int</MiMenuLevel>
            <MiOverridePrice>string</MiOverridePrice>
            <MiWeight>string</MiWeight>
            <MiReference>string</MiReference>
            <ItemDiscount xsi:nil="true" />
          </MenuItem>
          <Condiments>
            <ResPosAPI_MenuItemDefinition xsi:nil="true" />
            <ResPosAPI_MenuItemDefinition xsi:nil="true" />
          </Condiments>
        </ResPosAPI_MenuItem>
        <ResPosAPI_MenuItem>
          <MenuItem>
            <MiObjectNum>int</MiObjectNum>
            <MiMenuLevel>int</MiMenuLevel>
            <MiOverridePrice>string</MiOverridePrice>
            <MiWeight>string</MiWeight>
            <MiReference>string</MiReference>
            <ItemDiscount xsi:nil="true" />
          </MenuItem>
          <Condiments>
            <ResPosAPI_MenuItemDefinition xsi:nil="true" />
            <ResPosAPI_MenuItemDefinition xsi:nil="true" />
          </Condiments>
        </ResPosAPI_MenuItem>
      </ppMenuItems>
      <ppComboMeals>
        <ResPosAPI_ComboMeal>
          <ComboMealMenuItem>
            <MenuItem xsi:nil="true" />
            <Condiments xsi:nil="true" />
          </ComboMealMenuItem>
          <ComboMealObjectNum>int</ComboMealObjectNum>
          <ComboMealMainItem>
            <MenuItem xsi:nil="true" />
            <Condiments xsi:nil="true" />
          </ComboMealMainItem>
          <SideItems>
            <ResPosAPI_MenuItem xsi:nil="true" />
            <ResPosAPI_MenuItem xsi:nil="true" />
          </SideItems>
        </ResPosAPI_ComboMeal>
        <ResPosAPI_ComboMeal>
          <ComboMealMenuItem>
            <MenuItem xsi:nil="true" />
            <Condiments xsi:nil="true" />
          </ComboMealMenuItem>
          <ComboMealObjectNum>int</ComboMealObjectNum>
          <ComboMealMainItem>
            <MenuItem xsi:nil="true" />
            <Condiments xsi:nil="true" />
          </ComboMealMainItem>
          <SideItems>
            <ResPosAPI_MenuItem xsi:nil="true" />
            <ResPosAPI_MenuItem xsi:nil="true" />
          </SideItems>
        </ResPosAPI_ComboMeal>
      </ppComboMeals>
      <pSvcCharge>
        <SvcChgObjectNum>int</SvcChgObjectNum>
        <SvcChgAmountOrPercent>string</SvcChgAmountOrPercent>
        <SvcChgReference>string</SvcChgReference>
      </pSvcCharge>
      <pSubtotalDiscount>
        <DiscObjectNum>int</DiscObjectNum>
        <DiscAmountOrPercent>string</DiscAmountOrPercent>
        <DiscReference>string</DiscReference>
      </pSubtotalDiscount>
      <revenueCenter>int</revenueCenter>
      <orderType>short</orderType>
      <employeeNumber>int</employeeNumber>
      <pTotalsResponse>
        <TotalsSubTotal>string</TotalsSubTotal>
        <TotalsTaxTotals>string</TotalsTaxTotals>
        <TotalsOtherTotals>string</TotalsOtherTotals>
        <TotalsAutoSvcChgTotals>string</TotalsAutoSvcChgTotals>
        <TotalsTotalDue>string</TotalsTotalDue>
      </pTotalsResponse>
    </CalculateTransactionTotals>
  </soap:Body>
</soap:Envelope>

@Karthik23

One thing I can see is Envelope spelling is wrong so it is not able to get the value… Hence Object reference error.

And also SopaEnvelope + “Enevlope” will give Envelope 2 times I believe…correct them according to the xml

cheers

Hi Anil,

I have fixed the typo error. However I’m still getting the same error.


I’m taking the Soapenvelope variable value from XML_Calculateresponse.root.name method. where XML_Calculateresponse is the output of XML deserialize.
image

Hi,

Hope the following sample helps you.

Sample20221228-1L.zip (3.2 KB)

Regards,

1 Like

Thank you @Yoichi, it is working now.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.