0 Replies Latest reply: Jan 30, 2013 12:42 PM by 988155 RSS

    Using a Response XSL on XAI Inbound Service creates an invalid XML

    988155
      I created a Response XSL and plugged it into my XAI Inbound Service, however the Response XML it creates is invalid:

      <?xml version="1.0" ?>
      <SOAP-ENV:Envelope xmlns:SOAP-ENV="urn:schemas-xmlsoap-org:envelope">
      <SOAP-ENV:Body >
      *<?xml version="1.0" encoding="UTF-8"?>*
      <CmAccountSearch>
      <Request AccountNumber="" StreetNumber="740" StreetLine1="Polaris Ave" City="Foster City" State="CA"/>
      <Response ReturnCode="I">
      <CustomerDetailsList AccountNumber="9231764166" CustomerName="Rovno,Aleksandr" AmountDue="0" IsCashOnly="false" StreetLine1="740 Polaris Ave"/>
      <CustomerDetailsList AccountNumber="0304039866" CustomerName="Ray,Jamse" AmountDue="0" IsCashOnly="false" StreetLine1="740 Polaris Ave"/>
      </Response>
      </CmAccountSearch>
      </SOAP-ENV:Body >
      </SOAP-ENV:Envelope>

      Note that a second <?xml...> tag is created after the SOAP tags.

      -----

      Here is my XSL:
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
           <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
           <xsl:template match="/">
                <CmAccountSearch>
                     <xsl:apply-templates/>
                </CmAccountSearch>
           </xsl:template>
           <xsl:template match="input">
                <xsl:element name="Request">
                     <xsl:attribute name="AccountNumber">
                          <xsl:value-of select="accountId"/>
                     </xsl:attribute>
                     <xsl:attribute name="StreetNumber">
                          <xsl:value-of select="streetNumber"/>
                     </xsl:attribute>
                     <xsl:attribute name="StreetLine1">
                          <xsl:value-of select="streetName"/>
                     </xsl:attribute>
                     <xsl:attribute name="City">
                          <xsl:value-of select="city"/>
                     </xsl:attribute>
                     <xsl:attribute name="State">
                          <xsl:value-of select="state"/>
                     </xsl:attribute>
                </xsl:element>
           </xsl:template>
           <xsl:template match="output">
                <xsl:element name="Response">
                     <xsl:attribute name="ReturnCode">
                          <xsl:value-of select="returnCode"/>
                     </xsl:attribute>
                     <xsl:for-each select ="//customerDetails">
                          <xsl:element name="CustomerDetailsList">
                               <xsl:attribute name="AccountNumber">
                                    <xsl:value-of select="accountId"/>
                               </xsl:attribute>
                               <xsl:attribute name="CustomerName">
                                    <xsl:value-of select="customerName"/>
                               </xsl:attribute>
                               <xsl:attribute name="AmountDue">
                                    <xsl:value-of select="currentAmountDue"/>
                               </xsl:attribute>
                               <xsl:attribute name="IsCashOnly">
                                    <xsl:value-of select="cashOnlySw"/>
                               </xsl:attribute>
                               <xsl:attribute name="StreetLine1">
                                    <xsl:value-of select="premiseAddressLine1"/>
                               </xsl:attribute>
                          </xsl:element>
                     </xsl:for-each>
                </xsl:element>
           </xsl:template>
      </xsl:stylesheet>

      -----

      Here is the Response XML before applying the Response XSL to the XAI Inbound Service:
      <?xml version="1.0" ?>
      <SOAP-ENV:Envelope xmlns:SOAP-ENV="urn:schemas-xmlsoap-org:envelope">
      <SOAP-ENV:Body >

      <CmAccountSearch>
      <input>
      <accountId/>
      <streetNumber>740</streetNumber>
      <streetName>Polaris Ave</streetName>
      <city>Foster City</city>
      <state>CA</state>
      </input>
      <output>
      <customerDetails>
      <accountId>9231764166</accountId>
      <customerName>Rovno,Aleksandr</customerName>
      <currentAmountDue>0</currentAmountDue>
      <cashOnlySw>false</cashOnlySw>
      <premiseAddressLine1>740 Polaris Ave</premiseAddressLine1>
      </customerDetails>
      <customerDetails>
      <accountId>0304039866</accountId>
      <customerName>Ray,Jamse</customerName>
      <currentAmountDue>0</currentAmountDue>
      <cashOnlySw>false</cashOnlySw>
      <premiseAddressLine1>740 Polaris Ave</premiseAddressLine1>
      </customerDetails>
      <returnCode>I</returnCode>
      </output>
      </CmAccountSearch>
      </SOAP-ENV:Body >
      </SOAP-ENV:Envelope>

      I would like to know if anyone is familiar with this issue and how I can go about to fix it.

      Any response will be greatly appreciated.

      Thanks in advance.