cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

How do I read XML tag value when it contains namespace like ns0:

rpriya
2-Explorer

How do I read XML tag value when it contains namespace like ns0:

I have a soap response from a PostXML call.

Need help in reading the value of a tag: Ticket_number

I am not able to read the value TKT0001, more so because of the namespace

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <soapenv:Body>

  <ns0:Test_soap_service xmlns:ns0="urn:Create_Ticket" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <ns0:Ticket_Number>TKT0001</ns0:Ticket_Number>

  </ns0:Test_soap_service>

  </soapenv:Body>

  </soapenv:Envelope>

3 REPLIES 3
CRArko
17-Peridot
(To:rpriya)

Hello, Ranjan.

Are you getting an error thrown when you try to read TKT0001, or getting an empty value? If there is an error, what is that?

Thanks,

-- Craig A.

rnayak-2
12-Amethyst
(To:rpriya)

try the below ! where 'response' is the soap response you got from the web service

var result= response.*::Body.*::Test_soap_service.*::Ticket_Number

rpriya
2-Explorer
(To:rnayak-2)

Thanks Raghu

It worked..

Announcements


Top Tags