cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PI 7.3 Webservices security

former_member611341
Participant
0 Kudos

Im on SAP PI 7.3 Java sack only.

Scenario : I'm consuming a external web service for which I need to send security details in header in below format WSSE.

SAP ECC -> PI -> External web service.

<wsse:Security>

<wsse:UsernameToken>

<wsse:Username>XXXX</wsse:Username>

<wsse:Password>XXXXXXXXX</wsse:Password>

</wsse:UsernameToken>

</wsse:Security>

How can I achieve this?

I have read few posts  here on forum but couldn't get full informantion.

Please help.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor
0 Kudos

Hi Aday,

You can check below blogs to set the authentication header.

[SAP PI] &amp;#8211; Customize Message with XSLT Mapping | Simon Les Flex&amp;#039;s Blog

Regards,

Praveen

Answers (4)

Answers (4)

former_member611341
Participant
0 Kudos

Solved the XSLT issue.  This is my final XSLT

Thanks for your inputs.

With this XSLT mapping I'am able to produce the desired request message.

This online free toold helped me a lot to test my XSL:

http://www.freeformatter.com/xsl-transformer.html#ad-output

Now another error:

I'm trying to consume a Salesforce web-service which I tested in SOAPUI  tool successfully.

ECC <->PI<-> Sales force web service


Now when I test from ECC, I'm seeing different error in SAP PI.

"SOAP: Response message contains an errorXIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Security requirements are not satisfied because the security header is not present in the incoming message."

I believe this is issue to do with the repose message.

When I go see the failed message payload it looks good. If I use the same message payload and test using the SOAP UI tool it works  perfectly fine. So that's the reason I think my request message is fine but the response is not.


How do I handle my response message? right now my response message type/Date ype is same as Soap Body structure from below.



Below is the structure of response message from SOAP UI tool


Thanks in Advance.

former_member186851
Active Contributor
0 Kudos

Did you check the "do not add soap enevelope" option in the Soap adapter?

former_member611341
Participant
0 Kudos

Yes I did.

former_member611341
Participant
0 Kudos

Thanks for all your suggestion.

First I tried Axis adapter, changed Comm channel config as per the document. But it didn't work, got an error. Looks like we are missing some of Axis adapter components.

As per your suggestions went with XSLT mapping.

Now I'm having an XSLT mapping error.

" SOAP: Call failed: com.sap.aii.af.service.mapping.MappingException: Mapping failed in runtimeTransformer Configuration Exception occurred when loading XSLT map.xsl; details: Could not compile stylesheet    "

This is my request coming from ECC.

This is my XSL mapping file

My message type (date types) for request is same in both Inbound and Outbound interfaces?

is it OK?

Mapping adds the header right? should the request message be different in Outbound interface?

Please help.

Thanks.

former_member186851
Active Contributor
0 Kudos

Hello Aday,

change the code to add content in soap Body.

former_member611341
Participant
0 Kudos

I didnt get you. Could you explain?

This is my first time doing XSLT mapping.

Thanks in advance.

iaki_vila
Active Contributor
0 Kudos

Hi Aday,

Personally i'd rather the XSL options pointed by Raghuraman and Praveen, Why?, because it's the quicker way to do it, the AXIS adapter needs to have the libraries installed and to do some stuff in the parametrization that sometimes it's a buit fuzzy to understand.

According the XSLT option you have also this blog with a howto: Tykall's blog: Incluir UsernameToken en cabecera SOAP

Regards.

former_member186851
Active Contributor
0 Kudos

Adyay,

You can use Java or XSLT mapping, Refer the below link