Quantcast
Channel: SCN : Blog List - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 676

"AddSOAPHeaderBean" module

$
0
0

AddSOAPHeaderBean? thinking??, is it a custom adapter module?? Well, it is a standard SAP module but unfortunately no where documented

 

1. What is the use?


As the module name indicates, we can add our own custom soap headers for incoming and outgoing message in XI using this module

 

2. How to use in channel?

 

Simply add AF_Modules/AddSOAPHeaderBean in require channel as a local ejb type with a module key entry e.g., 0, ns, auth etc.. as per your requirement

 

3. What parameters it supports?

 

Mandatory Parameter: namespace as key and it's value e.g., namespace           http://customheader.com
Optional Parameters: any textual key, pair values. Each key will become a soap header tag with the maintained value in module configuration
The module key will be suffixed with static 'ns' string and will become namespace prefix for each  soap header that is required via this module

e.g., if modulekey is 0, key is hdr1, value is 1234 then below value will be added in SOAP Header

<SOAP:Header><ns0:hdr1 xmlns:ns0='http://customheader.com'>1234</ns0:hdr1></SOAP:Header>

 

4.Use cases

 

Case1: for modulekey is 0, namespace http://customheader.com and hdr1      1234

Case1.JPG

 

Result:

 

<SOAP:Header>
<ns0:hdr1 xmlns:ns0='http://customheader.com'>1234</ns0:hdr1>
</SOAP:Header>

 

Case2 (tricky one): for modulekey is 0, namespace      http://customheader.com and authenticationHdr      <UserName>Praveen Gujjeti</UserName><Password>exposedpasswordinID</Password>

 

Case2.JPG

Result:

 

<SOAP:Header>
<ns0:authenticationHdr xmlns:ns0='http://customheader.com'>
<UserName>Praveen Gujjeti</UserName>
<Password>exposedpasswordinID</Password>
</ns0:authenticationHdr>
</SOAP:Header>

 

Case3 (same as case2, but we can hide all header params in ID): for modulekey is 0, namespace http://customheader.com and pwd.authenticationHdr <UserName>Praveen Gujjeti</UserName><Password>passwordNotExposedinID</Password>

 

Case3.JPG

 

Result:

 

<SOAP:Header>
<ns0:authenticationHdr xmlns:ns0='http://customheader.com'>
<UserName>Praveen Gujjeti</UserName>
<Password>passwordNotExposedinID</Password>
</ns0:authenticationHdr>
</SOAP:Header>


5. What other alternative solutions are available to add custom SOAP headers?


Well, adding custom soap headers has been a frequent integration requirement in XI world since XI3.0. Java/XSLT mapping to create custom headers is one such option. And recently, this feature was also introuduced with AXIS HandlerBean module. Also this feature seems to be available with WS adapter with some limitations


References for Alternative solutions

http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/18/axis-adapter-sender-comm-channel-with-usernametoken
http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/06/05/soap-axis-receiver-communication-channel--how-to-remove-xi-headers-from-payload

 

**Note: Though this module is a standard SAP one, but since it is not documented and released officially by SAP, developers should use this module at their own risk.

 

Regards,

Praveen Gujjeti


Viewing all articles
Browse latest Browse all 676

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>