on 04-22-2015 8:42 AM
Hi experts,
I have one requrement where I need to remove the prefix ns0 from the xml (given below) getting generated in message mapping.
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns0:ExecuteRequest xmlns:ns0="http://test/">
<ns0:_sRequestXML><inteflow>body</inteflow></ns0:_sRequestXML></ns0:ExecuteRequest></soap:Body></soap:Envelope>
I am usimg the below xslt and it is now adding one ns0 prefix in the tag <inteflow>.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<ExecuteRequest xmlns="http://test/">
<_sRequestXML>
<inteflow>
<xsl:copy-of select="//inteflow"/>
</inteflow>
</_sRequestXML>
</ExecuteRequest>
</xsl:template>
</xsl:stylesheet>
Result after using xslt.
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ExecuteRequest xmlns="http://test/"><_sRequestXML>
<inteflow xmlns:ns0="http://decisionintellect.com/inteport/"></inteflow></_sRequestXML></ExecuteRequest></soap:Body></soap:Envelope>
Can you please help. What is wrong in the xslt and how I can get the desired result.
Thanks & Regards,
Pratyus Ganguly
<?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pratyus
XMLAnonymizerBean works fine when I try it with your payload. Here is the config, basically I included the namespace for everything except the ns0.
Parameter Name | Parameter Value |
---|---|
anonymizer.acceptNamespaces | http://www.w3.org/2001/XMLSchema xsd http://www.w3.org/2001/XMLSchema-instance xsi http://schemas.xmlsoap.org/soap/envelope/ soap |
Before
After
Rgds
Eng Swee
Hi,
I have added the below module parameters in my soap receiver channel.
Parametr values i have given exactly same as you have mentioned
http://www.w3.org/2001/XMLSchema xsd http://www.w3.org/2001/XMLSchema-instance xsi http://schemas.xmlsoap.org/soap/envelope/ soap
But still ns0 prefixes are coming in the target message. Is there anything i am missing?
Thanks & regards,
Pratyus Ganguly
That's weird.
Since this is a SOAP receiver, how are you able to view that the content after the module still has the prefix? The content shown in the message monitor shows the value before any receiver module is executed. Are you able to login to the receiver system to view the payload there?
Anyway, try adding the following module, AF_Modules/MessageLoggerBean after the anonymizer, with the following parameters.
Name | Value |
---|---|
log.location | removeNS |
log.condition | 1 |
With this you should be able to view the payload after anonymizer (as shown in my screenshot - under removeNS entry)
You might want to provide a screenshot of the error you are getting.
If you are unable to view the payload after the conversion, you cannot conclude that the error is because the Anonymizer bean not working.
I would suggest that you test out the web service manually first via SOAPUI to check that it works correctly before proceeding to make the changes in PI.
I agree with Eng, XMLAnonymizer is best approach but if you want to try XSL here is an example:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.