cancel
Showing results for 
Search instead for 
Did you mean: 

Map source XML payload to a single contained string Parameter in target, during message mapping

Former Member
0 Kudos

Dear All,

I need to map the whole source XML in a single contained string Parameter in target structure, before sending to the third party bank URL. Please do not confuse with converting source XML payload to string field warped in XML format, I know lot of blog and discussion available for that on SCN.

As we know during the PI message mapping always the target structure will be wrapped in the XML format , however in my case the target XML  structure should be contained in a single string,  please the below detail for source and target.

Source structure:-

<?xml version='1.0' ?>

<PaymentInfoMessage>

<PaymentInfoRequest>

<CompanyCode>Partner01</CompanyCode>

<BankCode>BSFRSARI</BankCode>

<StartDate>2006-07-09T00:00:00</StartDate>

<EndDate>2006-07-09T00:00:00</EndDate>

<TransactionType>940</TransactionType>

</PaymentInfoRequest>

</PaymentInfoMessage>


Required Target Structure:-

Please see the below statement is from third party (bank) for target structure from their document.

“You have to build post command with parameter name strXmldata, that parameter will contain the XML request of the accounts statement.


Pseudocode:


replyXML = HTTPS_Post_B2B(”strXmldata=”+ statementReqXMLfile)

processReplyXMLinCORE-SYSTEM(replyXML)

The following is HTML file content, shows how to post that parameter with the statement XML request:


Note: In the following html examples, html used below only as a demonstration of how data can be posted to B2B Gateway (using HTML form tag), This example shows the use of HTML page which can be opened by the Internet browser, to post data, in case you have a program to post requests, you only have to post the XML (in bold), in the parameter named  strXmlData.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

<HEAD>

</HEAD>

<BODY>

<FORM action=https://<environment-domain/b2b/epay method=post>

<INPUT value='<?xml version="1.0" ?><PaymentInfoMessage><PaymentInfoRequest><BankCode>RIBLSARI</BankCode><CompanyCode> PARTNER0001</CompanyCode><StartDate>2004-05-29T00:00:00</StartDate><EndDate>2004-05-29T00:00:00</EndDate><TransactionType>940</TransactionType></PaymentInfoRequest></PaymentInfoMessage>' name=strXmldata>

<INPUT type=submit value=Proceed>

</FORM>

</BODY>

</HTML>

Figure 10– Example of a Accounts Statements Post Request


You can see from the above example, the italic is the URL, and the accounts statements request xml message in bold passed in the parameter strXmldata."


please let me know if any one has faced such requirement in their implementation.


Thanks,

Farhan

Accepted Solutions (1)

Accepted Solutions (1)

former_member181985
Active Contributor
0 Kudos

Hi Farhan,

try with HTTP_AAE adapter with POST protocol and payload parameter name as strXmldata (enable check box "Set Form")

Regards,

Praveen Gujjeti

Former Member
0 Kudos

Hi Praveen,

Thanks a lot for your prompt response. In fact I am using HTTP_AAE receiver adapter , and my scenario is RFC to HTTP_AAE . Could you please let me how would be my message mapping structure? I know my source data type whatever I have mentioned above, will come to PI through RFC, but what will be my target mapping structure?

Could you please elaborate on ESR configuration part.

Thanks,

Farhan

former_member181985
Active Contributor
0 Kudos

Hello Farhan,

The target thirda party (Bank) application partner system should provide the message structure in the form XSD/WSDL (or) you can create one data type (message type) in PI ESR based on sample xml files provided by third party system (Bank)

As per your details, you can create thirdparty structure as

<PaymentInfoMessage>

  <PaymentInfoRequest>

  <BankCode/>

  <CompanyCode/>

  <StartDate/>

  <EndDate/>

  <TransactionType/>

  </PaymentInfoRequest>

</PaymentInfoMessage>

Regards,

Praveen Gujjeti

Former Member
0 Kudos

Thanks again for the quick response Praveen. Third party(bank) web server does not support web service(No WSDL).

the structure you have mentioned above, this is my source structure, shall I do one to one mapping? as no change in source XML and target XML. However, my concern is once I will mention the Main Parameter Payload Parameter Name(strXmldata) under Set Form  how its get linked with the target payload after message mapping, do I need to do any extra configuration in ESR?

might be silly question Praveen, but I need to get clarified from expert like you, because I m alone in my PI team, moreover, I am on client site.

Thanks again for your all help pal.

Regards,

Farhan

former_member181985
Active Contributor
0 Kudos

if source and target structures are same then you don't even need a 1:1 mapping. But however, I am little uncertain on the usage of HTTP_AAE adapter in receiver mode since I never worked with forms till now. But as per SAP help it should work with "no mapping in your scenario case AND with POST protocol in HTTP_AAE receiver channel and payload parameter name as strXmldata (enable check box "Set Form")"


check SAP help for more details


Configuring the Java HTTP Adapter on the Receiver Channel - Advanced Adapter Engine - SAP Library


http://help.sap.com/saphelp_nw73ehp1/helpdata/en/3b/280fa6a8ab4dd4a6755f8ed5b9fc9c/content.htm


Please let me know the outcome


Regards,

Praveen Gujjeti

Former Member
0 Kudos

Hi Dude,

in ESR you can use "return as xml option " to push entire xml into a single field"

http://scn.sap.com/people/jyothi.anagani/blog/2010/06/17/convert-the-input-xml-to-string-in-pi-71-us...

Thanks,

Former Member
0 Kudos

Hey Praveen,  thanks a ton for continuous response. HTTP_AAE is completely new even for me as well, few clarification.

as my scenario is Sync RFC to HTTP_AAE, after importing the RFC I will get the outbound data types message types and service interface.

but for Outbound I need to create the required structure, and its sync scenario I Believe , I need to create two  mapping as follows.

1- Between RFC Request to HTTP_AAE req

2- Between HTTP_AAE response to RFC response


Still one doubt Praveen, Once I will check Set Form, and under Main Payload Parameter Name, I will put strXmldata. However, how can I map the source structure to strXmldata in maaping, I mean how the target payload will get linked to strXmldata in HTTP_AAE receiver communication channel?


Please let me know If I am not in sync with you.

Thanks,

Farhan

former_member181985
Active Contributor
0 Kudos

Hi Farhan,

I think, the HTTP_AAE adapter has functionality which can map payload to a defined parameter in configuration

Regards,

Praveen Gujjeti

gagandeep_batra
Active Contributor

Answers (0)