cancel
Showing results for 
Search instead for 
Did you mean: 

Transform payload to SOAP message using XSLT

0 Kudos

Hello,

I'm working with e-invoice for Finland (called Finvoice) and is supposed to send a soap message as a file via file/ftp adapter.

The output from SAP is an INVOIC idoc that is mapped to a given output structure. This works fine.

The soap envelope is created via xslt transformation.

The Envelope is created correctly but I'm struggling with how to add the payload to the message. It needs to look as shown below, (I'm just showing the essential part).

My problem is that I don't know how to add the doctype part via xslt:

<?xml version="1.0" encoding="ISO-8859-15"?>

<!DOCTYPE Finvoice SYSTEM "Finvoice.dtd">

I get validation errors when adding this in the xsl. The content of the payload looks good.

Does anyone know how this can be solved?

</SOAP-ENV:Header>

<SOAP-ENV:Body>

<eb:Manifest eb:id="Manifest" eb:version="2.0">

<eb:Reference eb:id="Finvoice" xlink:href="1017000018">

<eb:schema eb:location="http://www.pankkiyhdistys.fi/verkkolasku/finvoice/finvoice.xsd" eb:version="2.0"/>

</eb:Reference>

</eb:Manifest>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

<?xml version="1.0" encoding="ISO-8859-15"?>

<!DOCTYPE Finvoice SYSTEM "Finvoice.dtd">

<?xml-stylesheet type="text/xsl" href="Finvoice.xsl"?>

<Finvoice Version="1.2">

<SellerPartyDetails>

<SellerPartyIdentifier>SellerPartyIdentifier23456789012345</SellerPartyIdentifier>

<SellerOrganisationName>SellerOrganisationName3456789012345</SellerOrganisationName>

// Best regards Hans

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Hans,

This is how I solved it for a different type of message, the resulting xsd might still not validate but the structure works

the < and > signs should be replaced by the escaped character & lt ; without spaces


<xsl:text disable-output-escaping="yes">
&lt;!DOCTYPE MessageType SYSTEM "http://some.com/messageType.dtd"&gt;</xsl:text>

Edited by: ciochinah on Feb 28, 2011 11:17 AM

0 Kudos

Hello ciochinah!

Thanks for your excellent answer, it solved my problem

This is what the essential part of the xsl looks like:

....

</SOAP-ENV:Envelope>

<xsl:text disable-output-escaping="yes">&lt;?xml version="1.0" encoding="ISO-8859-15"?&gt;</xsl:text>

<xsl:text disable-output-escaping="yes">&lt;!DOCTYPE Finvoice SYSTEM "Finvoice.dtd"&gt;</xsl:text>

<xsl:processing-instruction name="xml-stylesheet">type="text/xsl" href="Finvoice.xsl"</xsl:processing-instruction>

<xsl:copy-of select="*"/>

</xsl:template>

</xsl:stylesheet>

// Best regards

Former Member
0 Kudos

glad to have been of help

Former Member
0 Kudos

hI,

How to add the the below soap frame thru XSLT mapping.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd">

<SOAP-ENV:Header>

<eb:MessageHeader xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd" SOAP-ENV:mustUnderstand="1" eb:version="2.0">

<eb:From>

<eb:PartyId>0037123456678</eb:PartyId>

<eb:Role>Sender</eb:Role>

</eb:From>

<eb:From>

<eb:PartyId>NDEAFIHH</eb:PartyId>

<eb:Role>Intermediator</eb:Role>

</eb:From>

<eb:To>

<eb:PartyId>FI2757800750155448</eb:PartyId>

<eb:Role>Receiver</eb:Role>

</eb:To>

<eb:To>

<eb:PartyId>OKOYFIHH</eb:PartyId>

<eb:Role>Intermediator</eb:Role>

</eb:To>

<eb:CPAId>yoursandmycpa</eb:CPAId>

<eb:ConversationId/>

<eb:Service>Routing</eb:Service>

<eb:Action>ProcessInvoice</eb:Action>

<eb:MessageData>

<eb:MessageId>20081228-010142</eb:MessageId>

<eb:Timestamp>2008-12-28T01:01:42+03:00</eb:Timestamp>

<eb:RefToMessageId/>

<eb:RefToMessageId>XS1027.LPTF82/268</eb:RefToMessageId>

</eb:MessageData>

</eb:MessageHeader>

</SOAP-ENV:Header>

<SOAP-ENV:Body>

<eb:Manifest eb:id="Manifest" eb:version="2.0">

<eb:Reference eb:id="Finvoice" xlink:href="XS1027.LPTF82/268">

<eb:Schema eb:location=" http://www.finvoice.info/yrityksen_verkkolasku/ladattavat/Tekniset tiedostot/schemat/Finvoice.xsd" eb:version="2.0"/>

</eb:Reference>

</eb:Manifest>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

<?xml version="1.0" encoding="ISO-8859-15"?>

<!DOCTYPE Finvoice SYSTEM "Finvoice.dtd">

<?xml-stylesheet type="text/xsl" href="Finvoice.xsl"?>

Thanks and Regards,

Hymavathi

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I am also working with the same scenario.

How to add the SOAP frame thru XSLT transform?-Please share if u have already..

Regards,

H