cancel
Showing results for 
Search instead for 
Did you mean: 

apply digital signature only on the body of the XML message

Former Member
0 Kudos

Dear All,

I have I have synchronous scenario(ABAP proxy to bank URL , through HTTP post) where I need to apply the digital signature only on the body of the XML payload. This scenario will be implementing in SAP PI 7.4 dual stack, which is in installation process, I am thinking to use ABAP proxy to SOAP/HTTP_AAE .

  1. I believe this requirement is not possible  without java mapping by any adapter alone (SOAP or HTTP_AAE), However I need help from you all expert to please suggest me best possible way by considering the below req. Which adapter shall I user for this? SOAP or HTTP_AAE, bank system is not a webservice
  2. If Java mapping is mandatory here, please any sample code with detail please. Also, after Processing(digital sig(bodyReqXML)->encode to base64->Zipped it) then send it over a parameter named strXmldata, this parameter will contain the XML. How can I achieve this?
  3. Below details is from bank system to post on their HTTPS URL.

Posting procees of Bulk Payments (Payroll) Process One: PRMSG

You have to build post command with parameter name strXmldata, that parameter will contain the XML request of Bulk Payments (Payroll) process one.

Pseudocode:

digitalSiganature =  get_Digital_Signature( bodyReqXML ) 

base64DigitalSignature = base64_Encoding (digitalSiganature) 

paymentReqXMLfile = buildPayrollXml(bodyReqXML, base64DigitalSignature) 

replyXML = HTTPS_Post_ZIPPED_DATA_TO_B2B(“strXmldata=”+ paymentReqXMLfile)

processReplyXMLinCORE-SYSTEM(replyXML)

The following is HTML file content, shows how to post that parameter with the Bulk Payments (Payroll) process one XML request:

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

<HTML>

<HEAD>

</HEAD>

<BODY>

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

<INPUT value='<?xml version="1.0"?>

<Message>

  <Header>

    <Sender>PARTNERO0001</Sender>

    <Receiver> RYBK</Receiver>

<MessageType>PRMSG</MessageType>

    <MessageDescription>Payroll Message- 200401M</MessageDescription>

<TimeStamp>2004-01-17T14:10:54</TimeStamp>

  </Header>

  <Body>

    <PayrollMessage>

      <PayrollMessageRef>0000000003666236</PayrollMessageRef>

      <PayrollMessageType>MT100-Payroll</PayrollMessageType>

      <PayrollTransactionCount>2</ PayrollTransactionCount>

      <PayrollTransactionAmount>21187.00</ PayrollTransactionAmount>

      <PayrollTransaction>

<SequenceNum>2000542758</SequenceNum>

        <TransactionData>:20:2000542758

:32A:040119SAR10632,00

:50:PARNER COMPANY1

:52A:RIBLSARI

:53B:/041072711001

:57A:SABBSARI

:59:/042021147001

EMPLOYEE NAME1

ADDRESS</TransactionData>

      </PayrollTransaction>

      <PayrollTransaction>

<SequenceNum>2000542759</SequenceNum>

<TransactionData>:20:2000542759

:32A:040119SAR10555,00

:50: PARNER COMPANY1

:52A:RIBLSARI

:53B:/041072569701

:57A:RIBLSARI

:59:/042679747008

EMPLOYEE NAME2

ADDRESS</TransactionData>

      </PayrollTransaction>

    </PayrollMessage>

  </Body>

  <Signature>

<SignatureValue>MIAGCSqGSIb3DQEHAqCAMIIEzgIBATELMAkGBSsOAwIaBQAwCwYJKoZIhvcNAQcB

oIIDdjCCA3IwggMgoAMCAQICBwez/AAAAJgwCQYFKw4DAh0FADBkMQswCQYDVQQG

EwJTQTEPMA0GA1UECBMGUml5YWRoMRAwDgYDVQQHEwdDZW50cmFsMQ4wDAYDVQQK

EwVTQU1CQTENMAsGA1UECxMERUNTRDETMBEGA1UEAxMKUGF0aEZpbmRlcjAeFw0w

MzExMDQwODU1NDlaFw0wNDExMDQwODU1NDlaMH0xHDAaBgkqhkiG9w0BCQEWDWVj

c2RAZWNzZC5jb20xCzAJBgNVBAYTAnNhMRAwDgYDVQQIEwdjZW50cmFsMQ8wDQYD

VQQHEwZyaXlhZGgxDjAMBgNVBAoTBWIyYnN1MQ0wCwYDVQQLEwRlc2NkMQ4wDAYD

VQQDEwVzYW1iYTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDaaHgjoukVEiVCKfbf

ZGRC3bByn6Ld8dQ0Fd2Q9A1l6E0QnbkqTZkfzaBPSsyxTBQjyLe/YDYA9XUDzTo+

nESJAgMBAAGjggGgMIIBnDAOBgNVHQ8BAf8EBAMCA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KFpKPDpP5KbVadsptQlS2dRQnQ

PAAAAAA=</SignatureValue>

  </Signature>

</Message>' name=strXmldata>

<INPUT type=submit value=Proceed>

</FORM>

</BODY>

</HTML>

Figure 11 – Example of a Bulk Payments (Payroll) Process One Post Request

Note:

  • 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.
  • Because the request size is big, the data has to be compressed (zipped) before sending.

You can see from the above example, the italic is the URL, and the Bulk Payments (Payroll) file process one xml message in bold passed in the parameter strXmldata.

When you post the above request to the B2B Gateway, the gateway will receive the request analyze it, and answer back in the same session with the Bulk Payments (Payroll) acknowledge.

I am sorry for the big massage, Please suggest me as I am alone PI resource project.

Thanks,

Farhan

Accepted Solutions (1)

Accepted Solutions (1)

rhviana
Active Contributor
0 Kudos

Hi Farhan,

You must insert the tag <Signature> inside body, right ?

For that you need use javamapping , and recommend you to use DOM, could you please check my blog that I explain step by step how to insert node into any part of document.

Javamapping inserting nodes into XML structure:

http://scn.sap.com/docs/DOC-45642

Also check this amaizing blog from about digital signature

http://scn.sap.com/docs/DOC-49354

Kind regards,

BR.

Ricardo Viana.

Former Member
0 Kudos

Thanks a lot Ricardo for your prompt response. yes you are correct I need to insert the signature on  tag <Signature> inside body. I am going through the link, I will come back if I need any help.

one more question if you will see they asked me to post the whole message contained in a single string field strXmldata,as shown below.


/Message>' name=strXmldata>

<INPUT type=submit value=Proceed>

</FORM>

could you please help me understand this, how exactly they want. I am not closing this thread now, I will close after testing everything, thanks a ton for your help.

Regards,

Farhan

rhviana
Active Contributor
0 Kudos

Farhan,

Just read my blog that you will understand how insert node.

About this srtXmlData, I dont know, let see if another expert could help us.

As I understand it's look like reference of whole xml inside this tag into HTML structure, but not sure.


If you need help, let me know.

Regards,

BR.

Viana.

Former Member
0 Kudos

Thanks Ricardo, I was going through your blog and java code only. First of all great blog pal. Congratulation!!!

The HTML code they have shown just for demonstration purpose to post their URL, do you think, I need to covert  the whole xml payload to string and map to strXmldata ?

Thanks,

Farhan

Answers (0)