Karthik23
(Karthik )
December 27, 2022, 1:35pm
1
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
ppr
(Peter)
December 27, 2022, 1:44pm
2
Have a look below where the handling of XML Namespaces is introduced:
Going ahead
Serializing the XML - output: xDoc | DataType: XDocument:
[grafik]
Checking if we have to handle XML namespaces
[grafik]
We do have:
[grafik]
Checking for some children:
[grafik]
Defining Namespace Variable
[grafik]
Checkin the retrieval
[grafik]
xDoc.Descendants(xnsDefault + "productVersion")
GetDescendants { [<productVersion build="456" xmlns="http://tableau.com/api">123</productVersion>] }
xDoc.Descendants(xnsDefault + "productVersion").First().Value
"123"
xDoc.D…
Karthik23
(Karthik )
December 27, 2022, 2:08pm
3
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.
Karthik23
(Karthik )
December 27, 2022, 2:12pm
5
<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>
Anil_G
(Anil Gorthi)
December 27, 2022, 2:36pm
6
Karthik23:
Response
@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
Karthik23
(Karthik )
December 27, 2022, 2:48pm
7
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.
Yoichi
(Yoichi)
December 28, 2022, 12:09am
8
Hi,
Hope the following sample helps you.
Sample20221228-1L.zip (3.2 KB)
Regards,
1 Like
Karthik23
(Karthik )
December 28, 2022, 11:29am
9
Thank you @Yoichi , it is working now.
system
(system)
Closed
December 31, 2022, 11:30am
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.