Skip to Content

The requirement is to create a synchronous IDoc to SOAP scenario using certificates (https communication) without using ccBPM.

Also demonstrated the usage the parameterized XSLT mapping for creating custom SOAP envelop.

Usage of Java Only approach (AAE) to achieve this functionality by using standard modules Request Response and Response One Way Bean.

Some highlights:

  • Synchronous Messaging: IDoc to SOAP synchronous scenario. Receive responses from web-service and map it to ALEAUD IDocs and post it into SAP ECC.
  • Secured Communication: Usage of Certificate for https communication from SAP PI to Web-service
  • Custom Envelope – Creation of Custom SOAP envelop for request and response mapping using parameterized XSLT. The SOAP envelope changes based on the Sender Service (SAP Business System in Dev, QA and PRD).
  • Java Only Approach (usage of AAE): Usage of IDoc_AAE and standard modules, Request Response Bean and Response One Way Bean. No usage of ccBPM.

This functionality is tested on Tested on PI 7.3 Ehp1 SP 7 patch level 33 for XI ADAPTER FRAMEWORK(SAP_XIAF) using ECC 6.0.

Pre-Requisites:

1. Support Packages and Patches should be applied as per SAP note: 1964506

2. Latest patches should also be applied for SAPXIESR, MESSAGING and SAPXITOOL

3. SAP note 1810884 to be applied for JCE Unlimited Strength

4. SOAP UI to view the RAW XML structure for a successful posting to the web-service

Install the certificate in NWA of PI.

Go to the URL provided by Legacy Team and import the certificate.

Click on View Certificates:

Screen1.jpg

Select the complete Certificate Chain. Select ALL as highlighted.

Copy to File..

Screen2.jpg

Proceed as follows:

Screen3.jpg

Screen4.jpg

Click on Finish. The certificate is created.

Load the certificate into NWA of SAP PI.

Go to Configuration –> Certificates and Keys –> Trusted CA’s (certificate can be loaded in any other location also)

Screen5.jpg

Screen6.jpg

We can extract the WSDL from the Webservice URL.

Load the WSDL into External Definition of SAP PI.

Create Sender Service Interface. This uses the Request and Response Idocs EXCHANGE_RATE and ALEAUD respectively.

Screen7.jpg

Create Receiver Service Interface (this uses the External Definition created earlier)

Screen8.jpg

Create the Message Mapping and Operation Mappings.

After mapping the EXCHANGE_RATE IDoc to target structure using graphical mapping, we have to write an XSLT mapping to create a custom SOAP envelop for the request message. Crate 2 levels of mapping: XSLT and Graphical.

Screen9.jpg

Operation Mapping – Response

Screen10.jpg

Now,have to make use of SOAP UI to get a RAW XML message (RAW XML screen-shot below).

This RAW XML message is used to create the custom SOAP Envelope using XSLT mapping

SOAP UI screenshot of successful request sent to the webservice

Screen11.jpg

Design the XSLT mapping based on the SOAP UI RAW XML.

The XSLT mapping also uses parameters to determine the system based on “Sender_Service”.

The parameter “Sender Service” is highlighted in RED.

<!– <xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” xmlns:ns0=”XXXXXXXXXXXXXXXXXXXXWSSoap1/” xmlns:ns1=”https://XXXXXXXXXXXXXXXXXXXXXX/Currency_Tool_Web_Service/” exclude-result-prefixes=”ns0 ns1″>  –>

<xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” xmlns:ns0=”http://XXXXXXX.org/” xmlns:ns1=”http://schemas.XXXXXXXXXXXXXXXXXXXXXXXXX.UI.WebService” exclude-result-prefixes=”ns0 ns1″>

<xsl:output method=”xml” encoding=”UTF-8″/>

<xsl:param name =”SenderService”/>

  <xsl:template match=”/”>

<!– <soapenv:Envelope xmlns:cur=”https://XXXXXXXXXXX/CurrencyWSSoap1/” xmlns:cur1=”https://XXXXXXXX/CurrencyWSSoap1/Currency_Tool_Web_Service/
xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/“> –>

<soapenv:Envelope xmlns:tem=”http://XXXXXXXi.org/” xmlns:det=”http://schemas.datacontract.org/2004/07/Detica.BCEexe.UI.WebService
xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/“>

<xsl:variable name=”SenderSrv”>

   
<xsl:value-of select=”$SenderService”/>

  </xsl:variable>

<xsl:if test=”$SenderSrv = &apos;BS_ECC_ZE1120_DV&apos;”>

<soapenv:Header xmlns:wsa=”http://www.w3.org/2005/08/addressing“><wsse:Security soapenv:mustUnderstand=”1”
xmlns:wsse=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd“><wsse:UsernameToken wsu:Id=”UsernameToken-1”
xmlns:wsu=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd“><wsse:Username>XXXXXX</wsse:Username><wsse:Password
Type=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText“>YYYYYYYYY</wsse:Password><wsse:Nonce
EncodingType=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary“>FbAWL8iXrnTHlxnM6lntUg==</wsse:Nonce><wsu:Created>2014-03-13T09:59:41.772Z</wsu:Created></wsse:UsernameToken></wsse:Security><wsa:Action>loadCurrency</wsa:Action><wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address></wsa:ReplyTo>

</soapenv:Header>

  </xsl:if>

<xsl:if test=”$SenderSrv = &apos;BS_ECC_QE1100_QA&apos;”>

<soapenv:Header><wsse:Security soapenv:mustUnderstand=”1″ xmlns:wsse=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd“><wsse:UsernameToken wsu:Id=”UsernameToken-2”
xmlns:wsu=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd“><wsse:Username>AAAAAAAAA</wsse:Username><wsse:Password
Type=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText“>BBBBBBBBBBBBBB</wsse:Password><wsse:Nonce
EncodingType=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary“>QqLl4yF2CxN5fCm/UfeRwQ==</wsse:Nonce><wsu:Created>2014-03-13T10:09:50.302Z</wsu:Created></wsse:UsernameToken></wsse:Security></soapenv:Header>

</xsl:if>

<xsl:if test=”$SenderSrv = &apos;BS_ECC_PE1100_PR&apos;”>

<soapenv:Header xmlns:wsa=”http://www.w3.org/2005/08/addressing“><wsse:Security soapenv:mustUnderstand=”1”
xmlns:wsse=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd“><wsse:UsernameToken
wsu:Id=”UsernameToken-1″ xmlns:wsu=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd“><wsse:Username>XXXXXXXXXX</wsse:Username><wsse:Password
Type=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText“>YYYYYYYYYYYYYYY</wsse:Password><wsse:Nonce
EncodingType=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary“>daRBRgaMcST9pZG8vmtY5Q==</wsse:Nonce><wsu:Created>2013-11-07T13:29:07.869Z</wsu:Created></wsse:UsernameToken></wsse:Security><wsa:Action>loadCurrency</wsa:Action><wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address></wsa:ReplyTo>

</soapenv:Header>

  </xsl:if>

  <soapenv:Body>

  <tem:loadCurrency>

  <tem:cDTO>

  <det:Currencies>

  <xsl:for-each
select=”ns0:XXXXXXXX/ns0:cDTO/ns1:Currencies/ns1:Currency”>

  <det:Currency>

             
<det:Date_from><xsl:value-of select=”ns1:Date_from”/></det:Date_from>

             
<det:Id><xsl:value-of select=”ns1:Id”/></det:Id>

        
<det:Rate><xsl:value-of select=”ns1:Rate”/></det:Rate>

  </det:Currency>

  </xsl:for-each>

  </det:Currencies>

  </tem:cDTO>

  </tem:loadCurrency>

  </soapenv:Body>

</soapenv:Envelope>

</xsl:template>

  </xsl:stylesheet>

Please also read the  the Integration Directory and the response mapping in the second part of the blog IDoc to SOAP scenario using Certificates to create an Asynch-Synch Bridge: Part II

http://scn.sap.com/people/sudhansukumar.behera/blog/2014/12/15/idoc-to-soap-scenario-using-certificates-to-create-an-asynch-synch-bridge-part-ii

This is my first blog in SCN. Kindly request you to share you feedback and comment 🙂

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply