Hi Guys,
I have requirement to generate the escape characters in the XML message:
My input message:
<?xml version="1.0" encoding="UTF-8"?> <SiebelMessage ErrorMessage="INVALID STATE/COUNTRY" ErrorCode="1020" MsgType="Cr" IntObjectFormat="Siebel Hierarchical" IntObjectName="HS" MessageType="Integration"> <ListOfServiceProvider> <ServiceProvider> <Id>1</Id> <SAPVendorNumber/> </ServiceProvider> </ListOfServiceProvider> </SiebelMessage>
Using XSLT mapping to generate SOAP wrapper:
<?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:asi="http://siebel.com/asi/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="/"> <SOAP:Envelope> <soapenv:Header> <wsse:Security soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext"> <wsse:UsernameToken> <wsse:Username>O</wsse:Username> <wsse:Password Type="wsse:PasswordText">O</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> <soapenv:Body> <asi:HS1_spcGeneric_spcInbound_spcIntegration_spcWS_spcWrapper_Execute_Input> <asi:_XMLMessage> <xsl:copy-of select="." /> </asi:_XMLMessage> </asi:HS1_spcGeneric_spcInbound_spcIntegration_spcWS_spcWrapper_Execute_Input> </soapenv:Body> </SOAP:Envelope> </xsl:template> </xsl:stylesheet> <
Output after executing above XSL:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:asi="http://siebel.com/asi/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header> <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0"> <wsse:UsernameToken> <wsse:Username>O</wsse:Username> <wsse:Password Type="wsse:PasswordText">O</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> <soapenv:Body> <asi:HS1_spcGeneric_spcInbound_spcIntegration_spcWS_spcWrapper_Execute_Input> <asi:_XMLMessage> <SiebelMessage ErrorMessage="INVALID STATE/COUNTRY" ErrorCode="1020" MsgType="Cr" IntObjectFormat="Siebel Hierarchical" IntObjectName="HS" MessageType="Integration"> <ListOfServiceProvider> <ServiceProvider> <Id>1</Id> <SAPVendorNumber/> </ServiceProvider> </ListOfServiceProvider> </SiebelMessage> </asi:_XMLMessage> </asi:HS1_spcGeneric_spcInbound_spcIntegration_spcWS_spcWrapper_Execute_Input> </soapenv:Body> </SOAP:Envelope>
Expectation is to have the XML content in present in <asi:_XMLMessage> parameters with escape characters as shown below:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:asi="http://siebel.com/asi/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header> <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0"> <wsse:UsernameToken> <wsse:Username>O</wsse:Username> <wsse:Password Type="wsse:PasswordText">O</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> <soapenv:Body> <asi:HS1_spcGeneric_spcInbound_spcIntegration_spcWS_spcWrapper_Execute_Input> <asi:_XMLMessage> <SiebelMessage ErrorMessage="INVALID STATE/COUNTRY" ErrorCode="1020" MsgType="Cr" IntObjectFormat="Siebel Hierarchical" IntObjectName="HS" MessageType="Integration"> <ListOfServiceProvider> <ServiceProvider> <Id>1</Id> <SAPVendorNumber/> </ServiceProvider> </ListOfServiceProvider> </SiebelMessage> </asi:_XMLMessage> </asi:HS1_spcGeneric_spcInbound_spcIntegration_spcWS_spcWrapper_Execute_Input> </soapenv:Body> </SOAP:Envelope>
Please suggest if there is a way to convert the unescaped characters into escape characters by modifying in the same above XSL code?
Thanks.
Regards,
AJ