Topic
  • 1 reply
  • Latest Post - ‏2013-06-29T16:01:25Z by HermannSW
muvvala_ibm
muvvala_ibm
3 Posts

Pinned topic XML Header tag is missing after the transform

‏2013-06-29T11:25:08Z |

Hi All,

I am facing an issue in our project.

I am using the attached "JMS_req.xsl", in preparing the request xml file which is being posted to JMS Q, but the request is getting failed at JMS because of XML Header tag missing in the Request. 
From the probe, we see that we are posting the below content to the JMS, but we actually need the xml header added to this 
 
We are sending :
 
<ns1:COREBatchRequest
xmlns:ns1="http://www.bcbsma.com/b2b/CORE/COREBatchRequest"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<payloadType>abc</payloadType>
<payloadId>payload</payloadId>
<timestamp>time</timestamp>
<senderId>sender</senderId>
<payloadLocation>
<fileName>filename</fileName>
</payloadLocation>
<COREEnvelopeMetadata />
</ns1:COREBatchRequest>
 
 
What is expected 
 
<?xml version="1.0" encoding="UTF-8"?>
<ns1:COREBatchRequest
xmlns:ns1="http://www.bcbsma.com/b2b/CORE/COREBatchRequest"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<payloadType>abc</payloadType>
<payloadId>payload</payloadId>
<timestamp>time</timestamp>
<senderId>sender</senderId>
<payloadLocation>
<fileName>filename</fileName>
</payloadLocation>
<COREEnvelopeMetadata />
</ns1:COREBatchRequest>
 
Could you please help me in the XSLT to add the XML header.
 
Thanks in Advance,
 
Regards,
Chandra.

 

Attachments

Updated on 2013-06-29T11:26:00Z at 2013-06-29T11:26:00Z by muvvala_ibm
  • HermannSW
    HermannSW
    5829 Posts

    Re: XML Header tag is missing after the transform

    ‏2013-06-29T16:01:25Z  

    Hello,

    your stylesheet seems to be perfectly correct.

    I just executed it by coproc2 service, which returns the XML with the xml-declaration you want:

    $ echo "<foobar/>" | coproc2 JMS_req.xsl - http://dp2-l3:2223 ; echo
    <?xml version="1.0" encoding="UTF-8"?>

    <ns1:COREBatchRequest xmlns:ns1="http://www.bcbsma.com/b2b/CORE/COREBatchRequest" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <payloadType>abc</payloadType>
    <payloadId>payload</payloadId>
    <timestamp>time</timestamp>
    <senderId>sender</senderId>
    <payloadLocation>
    <fileName>filename</fileName></payloadLocation>
    <COREEnvelopeMetadata/></ns1:COREBatchRequest>
    $

     

    Please take a packet capture of the interface to your JMS backend.
    Select a packet from your transaction in eg. Wireshark and do a "Follow TCP Stream" then.
    It will show you whether the xml-declaration gets sent by DataPower or not.

    Based on above experiment I would think DataPower does send it, and then the problem is at your JMS backend.

    If not, please create a PMR.

     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>