cancel
Showing results for 
Search instead for 
Did you mean: 

How To remove tag in HCI

former_member213558
Active Participant
0 Kudos

Dear All,

i need to remove <?xmlversion="1.0" encoding="UTF-8"?> tag from my payload in HCI.

input Payload.

<?xml version="1.0" encoding="UTF-8"?>
<ns0:transfer xmlns:ns0="http://www.quantiguous.com/services">
	<ns0:version>2</ns0:version>
	<ns0:uniqueRequestNo>20170000000666777888</ns0:uniqueRequestNo>
	<ns0:appID>28283</ns0:appID>
	<ns0:customerID>28283</ns0:customerID>
	<ns0:debitAccountNo>22222</ns0:debitAccountNo>
	<ns0:beneficiary>
		<ns0:beneficiaryDetail>
			<ns0:beneficiaryName>
				<ns0:fullName>RAJNIKANTH INDIA PVT.LTD</ns0:fullName>
			</ns0:beneficiaryName>
			<ns0:beneficiaryAddress>
				<ns0:address1>ANJANEYA OPP: HIRANANDANI FOUND. SC</ns0:address1>
				<ns0:country>IN</ns0:country>
			</ns0:beneficiaryAddress>
			<ns0:beneficiaryContact>
				<ns0:mobileNo>+910000000000</ns0:mobileNo>
				<ns0:emailID>yes.singh@abc.com</ns0:emailID>
			</ns0:beneficiaryContact>
			<ns0:beneficiaryAccountNo>222222</ns0:beneficiaryAccountNo>
			<ns0:beneficiaryIFSC>HDFC0000000</ns0:beneficiaryIFSC>
			<ns0:beneficiaryMobileNo>+910000000000</ns0:beneficiaryMobileNo>
			<ns0:beneficiaryMMID>28283</ns0:beneficiaryMMID>
		</ns0:beneficiaryDetail>
	</ns0:beneficiary>
	<ns0:transferType>NEFT</ns0:transferType>
	<ns0:transferCurrencyCode>INR</ns0:transferCurrencyCode>
	<ns0:transferAmount>10000.00</ns0:transferAmount>
	<ns0:remitterToBeneficiaryInfo>00000006667778882017ASPL</ns0:remitterToBeneficiaryInfo>
</ns0:transfer>

Expected Payload.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ns0="http://www.quantiguous.com/services">
	<soap:Header/>
	<soap:Body>
		<ns0:transfer xmlns:ns0="http://www.quantiguous.com/services">
			<ns0:version>2</ns0:version>
			<ns0:uniqueRequestNo>20170000000666777888</ns0:uniqueRequestNo>
			<ns0:appID>28283</ns0:appID>
			<ns0:customerID>28283</ns0:customerID>
			<ns0:debitAccountNo>22222</ns0:debitAccountNo>
			<ns0:beneficiary>
				<ns0:beneficiaryDetail>
					<ns0:beneficiaryName>
						<ns0:fullName>RAJNIKANTH INDIA PVT.LTD</ns0:fullName>
					</ns0:beneficiaryName>
					<ns0:beneficiaryAddress>
						<ns0:address1>ANJANEYA OPP: HIRANANDANI FOUND. SC</ns0:address1>
						<ns0:country>IN</ns0:country>
					</ns0:beneficiaryAddress>
					<ns0:beneficiaryContact>
						<ns0:mobileNo>+910000000000</ns0:mobileNo>
						<ns0:emailID>yes.singh@abc.com</ns0:emailID>
					</ns0:beneficiaryContact>
					<ns0:beneficiaryAccountNo>222222</ns0:beneficiaryAccountNo>
					<ns0:beneficiaryIFSC>HDFC0000000</ns0:beneficiaryIFSC>
					<ns0:beneficiaryMobileNo>+910000000000</ns0:beneficiaryMobileNo>
					<ns0:beneficiaryMMID>28283</ns0:beneficiaryMMID>
				</ns0:beneficiaryDetail>
			</ns0:beneficiary>
			<ns0:transferType>NEFT</ns0:transferType>
			<ns0:transferCurrencyCode>INR</ns0:transferCurrencyCode>
			<ns0:transferAmount>10000.00</ns0:transferAmount>
			<ns0:remitterToBeneficiaryInfo>00000006667778882017ASPL</ns0:remitterToBeneficiaryInfo>
		</ns0:transfer>
	</soap:Body>
</soap:Envelope>


so, to get the expected payload i've used content modifier

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ns0="http://www.quantiguous.com/services">
   <soap:Header/>
   <soap:Body>
${in.body}
  </soap:Body>
</soap:Envelope>


 

i can see <?xml version="1.0" encoding="UTF-8"?> incoming payload and ${in.body} also taking along with that, but i don't want to pass this to target side..

please do suggest,

Thanks in Advance

Reagrds

Ramesh

Accepted Solutions (1)

Accepted Solutions (1)

Sriprasadsbhat
Active Contributor

Hello Ramesh,

You can do it by using below XSLT before adding SOAP:Envelope to your message.

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" omit-xml-declaration="yes" />
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

Regards,

Sriprasad Shivaram Bhat

Answers (2)

Answers (2)

0 Kudos

Hi SriPrasad,

My input xml is like below, I want to delete nodes <ns0:Message1> and

<ns0:Messagesxmlns:multimap="http://sap.com/xi/XI/SplitAndMerge">

but want to keep children as is.

<?xml version="1.0" encoding="UTF-8"?><ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">`This one need to be removed`
    <ns0:Message1> `This one need to be removed`
        <EmployeeTime><EmployeeTime><externalCode>e82baef39</externalCode><timeType>UK_MATERNITY</timeType><userId>101046</userId>>
                <Holiday><date>2016-03-25</date><date>2015-04-06</date><date>2015-05-25</date></Holiday></EmployeeTime></EmployeeTime></ns0:Message1>`This one need to be removed`
</ns0:Messages>`This one need to be removed`
Please help to remove the parent tags.
Thanks
,

Hi SriPrasad

If we have to remove parent node of xml, then how can we do it?

<?xml version="1.0" encoding="UTF-8"?><multimap:Messagesxmlns:multimap="http://sap.com/xi/XI/SplitAndMerge">`This one need to be removed`
    <multimap:Message1> `This one need to be removed`
        <EmployeeTime><EmployeeTime><externalCode>e82baef39</externalCode><timeType>UK_MATERNITY</timeType><userId>101046</userId>>
                <Holiday><date>2016-03-25</date><date>2015-04-06</date><date>2015-05-25</date></Holiday></EmployeeTime></EmployeeTime></multimap:Message1>`This one need to be removed`
</multimap:Messages>`This one need to be removed`
Sriprasadsbhat
Active Contributor
0 Kudos

Hello Salil,

Please create a new thread.

Regards,

Srip

former_member213558
Active Participant
0 Kudos

thanks a lot, it's working fine.

can you please help me out for my query which i've raised, https://answers.sap.com/questions/314810/connecting-pi-channel-from-hci-using-ssl-connectio.html

please do needful.