cancel
Showing results for 
Search instead for 
Did you mean: 

DynamicConfiguration to Message Header

Former Member
0 Kudos

Hello XI SDN'ers,

Does any one tried of reading or writing parameters to Header fields from Dynamic Configuration? If so, please advise me How to read and write the parameters.

Note: I am interested in parameters like SOAPAction, Cookie

Thanks & Regards,

Satish.

Accepted Solutions (0)

Answers (7)

Answers (7)

former_member190389
Active Contributor
0 Kudos

Could you check in message monitoring of RWB about the process?

former_member190389
Active Contributor
0 Kudos

hi,

See above u have written value.a as Set_Cookie.

I guess it should be Set-Cookie.. and not with an underscore.

Former Member
0 Kudos

sorry I have written wrongly in my earlier reply, but in my configuration it was written correctly as "Set-Cookie".

former_member190389
Active Contributor
0 Kudos

what error do you get?

former_member190389
Active Contributor
0 Kudos

Did you set the Adapter Specific Message Attributes in the Advanced tab of the Communication Channel.

Former Member
0 Kudos

I don't have option such option


Adapter Specific Message Attributes in the Advanced tab of the Communication Channel

in SOAP Adapter.

I am not getting any error, simply the value is not read from the HTTP header.

Thanks & Regards,

Satish.

former_member190389
Active Contributor
0 Kudos

for writing selecct Adapter specific message attributes

DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP","THeaderSOAPACTION
");

other parameters are

1. Server URL (you can set the complete URL here) TServerLocation

2. Authentication Key TAuthKey

3.Proxy URL TProxyLocation

4.Proxy Authentication Key TProxyAuthKey

regards

Former Member
0 Kudos

I already wrote an UDF to transfer (write) the cookie and SOAP action parameter to Dynamic Configuration, but I am unable to transfer (write) further to HTTP Header.

I added the respective Module in the communication chennel:

AF_Adapters/axis/HandlerBean

and their respective parameters:

handle.type: java:com.sap.aii.axis.xi.XI30DynamicConfigurationHandler

key.a: read http://sap.com/XI/SystemHTTP SetCookie

location.a: header

value.a: Set_Cookie

these steps are described in the following document:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b092777b-ee47-2a10-17b3-c5f59380...

but still I am facing problem.

Thanks & Regards,

Satish.

stefan_grube
Active Contributor
0 Kudos

Use "write" instead of "read" and put the XI30DynamicConfigurationHandler between XI30OutboundHandler and HTTPSender.

Let me know if this works.

Regards

Stefan

Former Member
0 Kudos

Hello Stefan,

I tried the way you described, I am still getting "NULL" value.

I did as follows:

Processing Sequence:


1    AF_Adapters/axis/AFAdapterBean                afreq
2    AF_Adapters/axis/HandlerBean                     xireq----------------------O/B Handler
3    AF_Adapters/axis/HandlerBean                     dcreq---------------------- This is for Dynamic Configuration (write)
4    AF_Adapters/axis/HandlerBean                     rem------------------------- Header Removal handler  
5    AF_Adapters/axis/HandlerBean                     dcres----------------------This is for Dynamic Configuration (read)
6    AF_Adapters/axis/HandlerBean                     trp--------------------------- HTTPSender
7    AF_Adapters/axis/HandlerBean                     xires------------------------O/BHandler
8    AF_Adapters/axis/AFAdapterBean                afres

Module Configuration looks as follows:


handler.type   java:com.sap.aii.axis.xi.XI30DynamicConfigurationHandler
key.a             write http://sap.com/XI/System/HTTP SetCookie (here, I want to read the Set-Cookie field from HTTP
                     Response header, so I used "read" previously and also I am not sure of the "NameSpace", because the 
                     namespace in my repository looks "http://sap.com/xi/XI/System/HTTP" )
location.a       header
value.a           Set-Cookie

If you have any other suggestions, please let me know.

Thanks & Regards,

Satish.

stefan_grube
Active Contributor
0 Kudos

The dcres should be after trp. What stand rem for?

Could you use the TCPGateway to see, if the set-cookie is part of the HTTP stream of the response?

The namespace is the same as you use in the dynamic header (ASMA). YOu can use any namespace you like, but it must be the same in the mapping and in the handler bean.

Regards

Stefan

Former Member
0 Kudos

Hallo Stefan,

Previously "dcres" was after "trp" only, since you told, I changed the sequence... so it doesn't work either before "trp" or after "trp".

rem -> is used as Heade Removal handler. I kept "Keep XI Headers" as true, but my webservice doesn't need that chunk, so I removed the SOAP Header using "rem"


handler.type    -      java:com.sap.aii.axis.soap.HeaderRemovalHandler
namespace     -      http://sap.com/xi/XI/Message/30

I use same namespace in both configuration und design as "http://sap.com/XI/System/HTTP"

Moreover I am using "TCPGateway" only, there I am able to see the webservice response has "Set-Cookie" value, for example my HTTP response header looks as follows:


HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
Set-Cookie: JSESSIONID=E51D3FA7D8E597749490BD51B9403229; Path=/
Content-Type: text/xml;charset=utf-8
Date: Tue, 03 Jun 2008 06:27:42 GMT
Connection: close

any other suggestion from your side?

Thanks & Regards,

Satish.

stefan_grube
Active Contributor
0 Kudos

I see. You do not want to set the cookie, but read this.

In that case you apply the handler after the trp and use read.

When you check SXMB_MONI and look for dynamic header, can you see any entry?

Besides: Which xi version/SP do you have?

Regards

Stefan

Former Member
0 Kudos

Hallo Stefan,

I checked SXMB_MONI but I don't even see node "DynamicConfiguration".

I am using PI7.0 SP13

-Satish.

Former Member
0 Kudos

Hello Stefan,

Is there any other update from your side regarding this problem? Do I have to go for SP14? or Do I have to write extra module to get the "Set-Cookie"?

Do you have any idea that this issue is solved in PI7.1?

Thanks & Regards,

Satish.

stefan_grube
Active Contributor
0 Kudos

The how-to guide which you refer to is written based in 7.0, so I have no idea why it does not work for you. I need to test it by my own but that will take some time.

Regards

Stefan

Former Member
0 Kudos

Hello Stefan,

"How to Guide" which I referred has some errors and I pointed that to "Kenny Scott" administrator of SDN. Kenny replied me today, saying soon author of the document will amend a new dokument correcting the errors.

so if you are planning to have some test scenarios based on this "How to Guide" please pay attention to "Section 3.4 "

Thanks & Regards,

Satish.

stefan_grube
Active Contributor
0 Kudos

Hi Satish,

if you have found errors in the H2G, let me know.

Regards

Stefan

Former Member
0 Kudos

Hello Stefan,

These are the errors I found in H2G.

Section 3.4, Point No.5, Page No. 9

Contradictory value is listed in Tabular column compared to the screen shot below. For example,

(1). Module Key "dcres" should be replaced to "dcreq"

(2). Parameter Name "Location.c" contains "header" as value in Tabular column but in the screen shot "context"

(3). Parameter Name "Value.c" contains "Cookie" as value in Tabular column but in the screen shot

"javax.xml.rpc.soap.http.soapaction.uri" again which one is correct value

regards,

Satish.

stefan_grube
Active Contributor
0 Kudos

The screen shots are correct.

The parameters of the XI30DynamicConfigurationHandler are:

key.nn: action nsuri name

action = insert, delete, read, write

nsuri name = refers to ASMA

location.nn: context, header, message (only if action = read/write)

context = message context

header = http header

message = XI message header

value.nn: value

action = insert: constant value

action = read/write:

-> location = message: messageId, refToMessageId, correlationId

-> location = header: any HTTP header field

-> location = context: any message context attribute

The module works like this:

read: a value from header/context/message is written to ASMA

write: a value from ASMA is written to header/context/message

insert: a constant is written to ASMA

delete: a ASMA value is deleted

So I cannot see anything wrong with your configuration.

Make sure, that there are no additional trailing spaces.

Regards

Stefan

Former Member
0 Kudos

Hello Stefan,

I cross-checked my configuration, there is no additional trailing spaces...

-Satish.

former_member190389
Active Contributor
0 Kudos

if you want to set a parameter using dyn conf see below code.Use it in the message mapping:


DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName"); // 

//String filename= conf.get(key);
conf.put(key, fileName);

return fileName;

here i wanted to set the fileName from the source message.

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

Probably you will have to change this parameter to something with the cookie or SOAPAction one.

regards

former_member190389
Active Contributor
0 Kudos

Yes i have tried for file adapter, which parameters do you want to write?

Former Member
0 Kudos

I am using SOAP (Axis) Adapter with HTTP Transport protocol. Moreover I am interested in reading or wirting HTTP Header (not SOAP Header) parameters like SOAPAction and Cookie.

Thanks & Regards,

Satish.