Skip to Content

Digital signature and validation for sync web-service

Nov 18, 2017 at 12:49 PM


avatar image

I need your immediate help to digitally sign request xml message for

synchronous webservice call on SAP PI 7.4(single stack). Requirement is

  1. SAP PI makes a request to the ZSMOPL, sends messages with the signature and the certificate used for the signature. This information must be in the header of the message (<soapenv: Header>). X.509 Certificates.

Can I use Soap adapter with webservice security profile? ( I tried this, but it throws error )

Or Do I have to go for java mapping. Can I please get the sample code to implement digital signature.

SOAP header template as provided by zsmopl" xmlns:soapenv="">

<soapenv:Header>" xmlns:wsu="">" ValueType="" wsu:Id="X509-925981AA89D6C41EB3144465584498121">MIIGQDCCA2owggJSoAMCAQICCQCuBuTAUz+owz">





</ds:Transforms>"/> eXyR08F9i3u8qQ3bJVccW6e/es8=


</ds:SignedInfo> <ds:SignatureValue>NS45ULI7S81aXmchf37FS2y6va</ds:SignatureValue>" wsu:Id="STR-925981AA89D6C41EB3144465584498123" xmlns:wsse11="">"/>







Receiver SOAP channel, select "Select Security Profile". The "Security Profile" should be "Web Services Security".

On your Receiver Agreement/ICO that uses this channel, select the "Security Standard" and select "Security Procedure (Request)" -> Sign.

On "Certificate for Signing (WS Request)", select your keystore and view for your digital certificate.

I have done above settings, then sent messages. Receiver SOAP channels throws error as " MP: exception caught with cause SOAP: Response message contains an errorXIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: An invalid security token was provided Caused by: An invalid security token was provided (Bad ValueType "")"

be adding modules given in the blog

I got the payload ( signed header + body ) sent by receiver SOAP Channel to zsmopl,

below is the payload.




<ds:Reference URI='#wsuid-body-0ac9b863-cc3f-11e7-ad57-0000007f6e76'>









<wsse:Reference URI='#sap-16'/>






I could identify the difference b/w PI payload and the template, differences are in PI payloads, below values missing

1.xml attribute ValueType=””. this should be populated 3 times
2.There is no values populated under <keyinfo> tags.

I believe this is causing error in PI. I've raised OSS note for fix from SAP.

Please suggest here how to proceed further.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
avinash M Dec 07, 2017 at 04:35 PM

This requirement ( wssec signing only ) was achieved using SOAP AXIS. Detailed explanation of the solution can be found at my blog : wssec signing

10 |10000 characters needed characters left characters exceeded
avinash M Nov 22, 2017 at 05:41 AM

Any updates Here !!

10 |10000 characters needed characters left characters exceeded
avinash M Nov 23, 2017 at 11:58 AM


SAP Confirmed that, SOAP Channel is not fully supporting WS-Security & suggested to use SOAP Axis. PI set-up is going on for this.

10 |10000 characters needed characters left characters exceeded
avinash M Nov 28, 2017 at 10:26 AM

Basis team deployed AXIS related jar into PI server ( xml sec 1.4.2 and wss4j - 1.5.6 ).

I've configured the receiver axis channel with ws-security signing. Screenshot below. When I run the scenario, I'm getting an error.

error log screenshot below.

screenshot.jpg (88.6 kB)
screenshot2.jpg (248.2 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Avinash,

please check all the components i.e (required and optional component is to be in ok status)has deployed or not using the standard url http://hostname:port/XIAxisAdapter/MessageServlet?parameters