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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

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

rpriya
1-Newbie

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
5-Regular Member
(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

Thanks Raghu

It worked..

Top Tags