on 10-03-2012 2:22 PM
Hi,
If for example you had to map into a web service which had a structure as follows:
<SOAP-ENV:Envelope .....>
<SOAP-ENV:Header>
<m:RequesterCredentials xmlns:m="urn:xxx:api:xxxAPI">
<m0:AuthToken></m0:AuthToken>
<m0:Credentials>
<m0:Username></m0:Username>
<m0:Password></m0:Password>
</m0:Credentials>
</m:RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<m:PayReq xmlns:m="urn:xxx:api:xxxAPI">
<m:PayRequest>
<m:ReceiverEmail></m:ReceiverEmail>
<m:ReceiverPhone></m:ReceiverPhone>
<m:ReceiverID></m:ReceiverID>
<m:Amount></m:Ammount>
</m:PayRequest>
</m:PayReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
...you have a problem because you would need to map into 2 separate message types (RequesterCredentials, PayReq) on the inbound side. As far as I am aware it is not possible to map into 2 message types within the integration builder.
In our production environment we actually have two examples of this and got round the problem in a different way in each case:
1. A java routine was developed to generate the SOAP Envelope
2. A wrapper service was written in .NET to mask the Header/Body structure and PI called this wrapper
These both work. However, I was wondering whether it is actually possible in PI to map to an inbound structure which contains this Header/Body format with 2 separate message types ?
For info we are on Service Pack 10, Release NW702_10_REL.
Cheers,
PaulC.
Hi Paul,
With a similar requeriment i solved it using an XSL mapping and to tick the DO NOT TO USE SOAP ENVELOPE in the Receiver SOAP channel.
An easy XSL example:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://XXXXXXX" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" version="1.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:attribute-set name="attr-soap">
<xsl:attribute name="soap:mustUnderstand">1
</xsl:attribute>
</xsl:attribute-set>
<xsl:template match="/ns0:MyRootTag">
<soap:Envelope>
<soap:Header>
<xsl:copy-of select="./ns0:TagWithTheHeaderBegins"/>
</soap:Header>
<soap:Body>
<xsl:copy-of select="./ns0:TagWithTheBodyBegins"/>
</soap:Body>
</soap:Envelope>
</xsl:template>
</xsl:stylesheet>
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Paul,
a "Message Mapping" requires to build the message type, what is time consuming if you have different namespaces. For building the enveloap in mapping time it is therefore easier to use xsl, where you just copy the wished result and put a bit xsl around. You dont need message types in that case, a dummy (one field) is enough, they are not validated.
Regards,
Udo
Hi Paul,
A few cents to Udo answer, you could use a message mapping and xsl mapping together, the output of one mapping will be the input on the second mapping. In this example (operation mapping):
I do all the mapping value or/and mapping structure issues in the message mapping and in the XSL just to put SOAP tags in the message mapping output. As Udo says the XSL output doesnt need to fit with the target Message structure, this is not a problem with the XSL mappings.
Regards.
Inaki/Udo,
Ok. So you seem to be saying it should in theory be possible to create an inbound structure as per my opening post using either XSL or a combination of graphical mapping and XSL. Would be interested in hearing a bit more about Inaki's solution if possible i.e. what the graphical mapping created and how this was then altered by the XSL mapping.
I have done some reading on XSL and there does seem to be disadvantages such as not being able to see the payload in SXI_MONI. Do you in general recommed XSL as a mapping solution or should it only be used in very specific situations ?
Cheers,
Paul.
Hi Paul,
you can use the combination if you want to reuse the already done mapping work. Business Mapping: with Message Mapping, easy to change
Around the enveloap with xsl: easy to develoap, copy and paste the enveloap, use of xsl:copy-of for result of message mapping.
The MONI supports messages, not mappings. It is no difference between results of MM or xsl.
If you use 2 mappings in one operation mapping, you wont be able to see the intermediate result in MONI. This is sometimes annoying, you can temporary delete the second mapping from operation mapping during development to work around.
MM is the standard.
XSL can be used for special cases (like you have), the most serious disadvantage is the missing graphical surface -> You have only source code and small changes always require a kind of understanding the whole mapping. It is very useful to copy parts of the source, handling namespaces and map to structures, where the target is very different from the source.
Regards,
Udo
A few cents,
Test purpose.
I usually test the Message Mapping first inside the test tab in the message mappings. If the output is ok the next step is to test the operation mapping in the test tab in the operation mapping.
If something fails in runtime you could take the inbound payload a to test it, first in the message mapping and later in the operation mapping.
How to use XSL mapping.
As Udo says the XSL mapping is less efficent that the message mapping, if it is posible you should to avoid it. In my own experience i have the next preferency to use mappings:
Example:
Output of my first message mapping:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:AltaFinalizacionRequest xmlns:ns0="http://xxx">
<ns0:CabeceraAltaFinalizacion>
<ns0:ano>1</ns0:ano>
<ns0:codigo>1</ns0:codigo>
</ns0:CabeceraAltaFinalizacion>
<ns0:CuerpoAltaFinalizacion>
<ns0:altaFinalizacion>
<ns0:contractTermination>
<ns0:enddate>2012-01-01T13:27:35.0Z</ns0:enddate>
<ns0:paidamountImporteIva>1</ns0:paidamountImporteIva>
<ns0:paidamountTaxExclusive>1</ns0:paidamountTaxExclusive>
<ns0:paidamountTipoIva>1</ns0:paidamountTipoIva>
</ns0:contractTermination>
<ns0:contractResolution>
<ns0:causetypecode/>
<ns0:description/>
<ns0:flagguaranteeloss/>
</ns0:contractResolution>
<ns0:listaDocumentos>
<ns0:DocumentoBeanWSRC>
<ns0:data/>
<ns0:descripcion/>
<ns0:nombre/>
<ns0:nombreArchivo/>
<ns0:tipoDocumento/>
</ns0:DocumentoBeanWSRC>
</ns0:listaDocumentos>
</ns0:altaFinalizacion>
</ns0:CuerpoAltaFinalizacion>
</ns0:AltaFinalizacionRequest>
XSL mapping:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://xxx" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" version="1.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:attribute-set name="attr-soap">
<xsl:attribute name="soap:mustUnderstand">1
</xsl:attribute>
</xsl:attribute-set>
<xsl:template match="/ns0:AltaFinalizacionRequest">
<soap:Envelope>
<soap:Header>
<ns0:ano xmlns:ns0="http://xxx">
<xsl:value-of select="./ns0:CabeceraAltaFinalizacion/ns0:ano"/>
</ns0:ano>
<ns0:codigo xmlns:ns0="http://xxx">
<xsl:value-of select="./ns0:CabeceraAltaFinalizacion/ns0:codigo"/>
</ns0:codigo>
</soap:Header>
<soap:Body>
<ns0:altaFinalizacion xmlns:ns0="http://xxx">
<xsl:copy-of select="./ns0:CuerpoAltaFinalizacion/ns0:altaFinalizacion/child::*"/>
</ns0:altaFinalizacion>
</soap:Body>
</soap:Envelope>
</xsl:template>
</xsl:stylesheet>
Message Mapping + XSL Mapping output:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ns0:ano xmlns:ns0="http://xxx">1</ns0:ano>
<ns0:codigo xmlns:ns0="http://xxx">1</ns0:codigo>
</soap:Header>
<soap:Body>
<ns0:altaFinalizacion xmlns:ns0="http://xxx">
<ns0:contractTermination>
<ns0:enddate>2012-01-01T13:28:39.0Z</ns0:enddate>
<ns0:paidamountImporteIva>1</ns0:paidamountImporteIva>
<ns0:paidamountTaxExclusive>1</ns0:paidamountTaxExclusive>
<ns0:paidamountTipoIva>1</ns0:paidamountTipoIva>
</ns0:contractTermination>
<ns0:contractResolution>
<ns0:causetypecode/>
<ns0:description/>
<ns0:flagguaranteeloss/>
</ns0:contractResolution>
<ns0:listaDocumentos>
<ns0:DocumentoBeanWSRC>
<ns0:data/>
<ns0:descripcion/>
<ns0:nombre/>
<ns0:nombreArchivo/>
<ns0:tipoDocumento/>
</ns0:DocumentoBeanWSRC>
</ns0:listaDocumentos>
</ns0:altaFinalizacion>
</soap:Body>
</soap:Envelope>
The XSL mapping could be easier if i would have prepared better the first message mapping
Regards.
Hi Paul,
...you have a problem because you would need to map into 2 separate message types (RequesterCredentials, PayReq) on the inbound side. As far as I am aware it is not possible to map into 2 message types within the integration builder.
- no, you can build only ONE message type for that
- you can map to two message types.. (not interesting for your taks)
- You need to have a http channel or a soap without envelope (because you want to influence the envelope during mapping time
- Create a corresponding message type (difficult) using a Message Mapping or, easier, create dummy message types and a xsl mapping.
- having user/password in the payload/enveloap of a message is of course risky
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
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.