on 07-25-2012 12:06 PM
Hi,
I have a question regarding the SOAP message sent by SOAP receiver adapter.
When I configure the User Authentication with username and password, will this value be sent in SOAP Header?
I want to send the message as below to External patrner
<?xml version="1.0" encoding="UTF-8"?>
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP:Header>
<AuthHeader xmlns="https://xyz.com/">
<Username>ABC</Username>
<Password>abc</Password>
</AuthHeader>
</SOAP:Header>
<SOAP:Body>
<ns1:Receiver xmlns:ns1="http://xyz.com/">
<ns1:tr1> <ns1:tr1>
</ns1:Receiver>
</SOAP:Body>
</SOAP:Envelope>
Please suggest,
Thanks
Sarkar
Few cents in addition to previous experts replies.. Please remember HTTP is the transport protocol for all SOAP messages.SOAP is mere message protocol. Actually the entire structure is as below..
HTTP Protocol contains two major portions namely HTTP HEADER & HTTP BODY.
HTTP HEADER requires authentication credentials like username/password, certificates, token etc
HTTP BODY contains SOAP Envelope (For all soap messages)
SOAP Envelope which in turn contains two major components (SOAP Header and SOAP BODY)
SOAP BODY contains directly Payload or references Payload (in our XI protocol).
If you need to customize anything in the SOAP Header structure, you can use mapping programs like java or xslt.
Hope that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gopal and Anupam
Thanks for your input.
as the receiver system expecting SOAP header in the SOAP message, I have used XSLT mapping and created a SOAP envelope and marked "Do Not Use SOAP Envelope" checkbox in the receiver SOAP Communication Channel.
After doing this the message was accepted at receiver end. But I am passing credentials in the XSLT mapping which is not good practice. tomorrow when the password is changed I have to come to dev box do the changes and transport.
Do you have any inputs how to remove the hard coded credentail from XSLT mapping?
Thanks in advance.
>tomorrow when the password is changed I have to come to dev box do the changes and transport.
Yes you have to do the same again.
Since your receiver system expects user credentials in the message structure, there is no workaround to avoid. You might request them to accept certificate authentication instead of user/password credentials. This way you dont need to do all these things in the message level.
Hi Sarkar,
did you test this message to external webservice using SOAP UI tool?
If login working using SOAP UI tool then this should l also work for SAP-PI. In case your system is having a proxy /firewall you need to configure details in SOAP receiver adapter. You can use java mapping or XSLT mapping to create the SOAP message structure you need to send.
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarkar,
In fact, the user credentials are sent within HTTP Header, not SOAP Header. See more details in my blog . If you want to include some additional values in the SOAP Header, you need to use XSLT mapping or Java mapping for that purpose, create the whole SOAP Envelope yourself, and mark "Do Not Use SOAP Envelope" checkbox in the receiver SOAP Communication Channel.
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Glowacki,
Thanks for your input.
as the receiver system expecting SOAP header in the SOAP message, I have used XSLT mapping and created a SOAP envelope and marked "Do Not Use SOAP Envelope" checkbox in the receiver SOAP Communication Channel.
After doing this the message was accepted at receiver end. But I am passing credentials in the XSLT mapping which is not good practice. tomorrow when the password is changed I have to come to dev box do the changes and transport.
Do you have any inputs how to remove the hard coded credentail from XSLT mapping?
Thanks in advance.
You're right - hardcoding user credentials in the XSLT mapping doesn't sound too neat. And transporting it from D to Q to P is even worse. Still, there are some workarounds that you could use for that purpose. For instance, you could create a Java function that will read the configuration from some config file stored somewhere in PI's file system. This Java function can then be called from the XSLT mapping, as described here:
http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/content.htm
Alternatively, you could store the credentials in the sender system and send them from there with every message, assuming that you can influence the sender part.
Regards,
Greg
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.