You need to sign in to do that
Don't have an account?
Manu Tej 9
XML Parsing
Hi all,
I am receiving the following XML response. Can someone help me to parse this response and get the value of "Assigned_Organization" inside the xml.
I dont know how to get the value of ns0: elements in below XML.
<?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:Query_ServiceResponse xmlns:ns0="urn:ABC_XYX_RE_Interface_Modify_WS">
<ns0:Assigned_Group>SFDC-SALESFORCE-CRM</ns0:Assigned_Group>
<ns0:Assigned_Shift_Name />
<ns0:Assigned_Support>My SOFT</ns0:Assigned_Support_Company>
<ns0:Assigned_Organization>ITSM</ns0:Assigned_Support_Organization>
</ns0:Query_ServiceResponse>
</soapenv:Body>
</soapenv:Envelope>
Thanks in advance
I am receiving the following XML response. Can someone help me to parse this response and get the value of "Assigned_Organization" inside the xml.
I dont know how to get the value of ns0: elements in below XML.
<?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:Query_ServiceResponse xmlns:ns0="urn:ABC_XYX_RE_Interface_Modify_WS">
<ns0:Assigned_Group>SFDC-SALESFORCE-CRM</ns0:Assigned_Group>
<ns0:Assigned_Shift_Name />
<ns0:Assigned_Support>My SOFT</ns0:Assigned_Support_Company>
<ns0:Assigned_Organization>ITSM</ns0:Assigned_Support_Organization>
</ns0:Query_ServiceResponse>
</soapenv:Body>
</soapenv:Envelope>
Thanks in advance
Refer below documnet.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_xml_dom.htm
Regards
Satish atla
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_xml_dom.htm
I think your responce is modified and posted here as your tags are mismatching with ending tag .
Please modify and post so that we can giv esolution to it .
Thanks
Mnaoj
Thank you for your reply. the actual problem was in response received. The response that I am receiving is not loaded correctly into the document class. I think that ns0 attribute is giving the problem. When this attribute is coming, the XML breaking there and added to new line. I dont know what exactly the problem is.
Which webservice you are using ,If have any contact to teh vendor so that they can modify if they have any issue .