cancel
Showing results for 
Search instead for 
Did you mean: 

How do I access the DCJMS* variables in my response <SOAP:Header>?

Former Member
0 Kudos

Hi all,

I have set up a sync / async Integration Process in XI

This is initiated by a SAP R/3 transaction that calls a synchronous function to enter XI

Once in the Bridge, a JMS receiver adapter sends out an asynchronous request message from XI to MQ

A correlation allows the JMS sender adapter to return an asynchronous response message from MQ to XI back into my the Integration Process

I have set up the JMS sender adapter configuration to return the DC (dynamic configuration) variables in the <SOAP:Header> of the XI response message along with the payload

You can see that the DCJMS* variables are returned below

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!--

Response

-->

- <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SAP="http://sap.com/xi/XI/Message/30">

- <SOAP:Header>

+ <SAP:Main xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsu="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" versionMajor="003" versionMinor="000" SOAP:mustUnderstand="1" wsu:Id="wsuid-main-92ABE13F5C59AB7FE10000000A1551F7">

+ <SAP:ReliableMessaging xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

+ <SAP:HopList xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

+ <SAP:RunTime xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

+ <SAP:PerformanceHeader xmlns:SAP="http://sap.com/xi/XI/Message/30">

- <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSCorreleationID">40D982A0-B19D-11DB-9508-0002A5D5916B</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSTimestamp">1170297456940</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSMessageID">ID:414d5120514d4430312020202020202045c12b962001dd02</SAP:Record>

</SAP:DynamicConfiguration>

- <SAP:Diagnostic xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:TraceLevel>Information

<b>Question</b>

I want to access the DCJMS* variables but am not sure how to go about it as the

variables exist in the <SOAP:Header>?

I followed the SAP documentation to access adapter-specific attributes (refer to link http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm )

I have used the following code to create a user-defined function for the accessing adapter specific attributes (similar to the link)

public String Get_Msgid(Container container){

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get

(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create

("http://sap.com/xi/XI/System/JMS","DCJMSMessageID");

String jmsMsgID = conf.get(key);

return jmsMsgID;

}

<b>Question</b>

Do I use message mapping to extract the DCJMS* variables?

<b>Question</b>

If so then which message is used for the source message so that I can access the <SOAP:Header>? Eg do I use the response message type or is there a trick to accessing the SOAP:Header?

<b>Question</b>

Do I use the user-defined function (like above)?

I performed the following steps

• Opened the message mapping in edit mode

• Created the user-defined function using the graphical editor

• Saved the message mapping

• I have not connected the user-defined function to any of the xml tags in either the source or target messages

When I go to test the message mapping I am getting the following error

Compilation process error : CreateProcess: null\bin\javac -J-Xmx256m @E:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd79a7bf0b65611dbaf390002a5d5916b/O1170817003886.txt @E:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd79a7bf0b65611dbaf390002a5d5916b/S1170817003886.txt error=2

STACKTRACE:

com.sap.aii.ib.core.mapping.exec.ExecuteException: Compilation process error : CreateProcess: null\bin\javac -J-Xmx256m @E:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd79a7bf0b65611dbaf390002a5d5916b/O1170817003886.txt @E:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd79a7bf0b65611dbaf390002a5d5916b/S1170817003886.txt error=2

at com.sap.aii.ib.server.mapping.exec.ServiceUtil.compileSourceCode(ServiceUtil.java:207)

at com.sap.aii.ib.server.mapping.exec.ServiceUtil.compile(ServiceUtil.java:156)

at com.sap.aii.ibrep.server.mapping.ServerMapService.compileSourceCode(ServerMapService.java:361)

at com.sap.aii.ibrep.server.mapping.ServerMapService.compileSourceCodeWithoutAndWithArchives(ServerMapService.java:301)

at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:153)

at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)

at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:259)

at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)

at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:304)

at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:193)

at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:122)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

A thread in the SDN (Error while Activating Message Mapping, Posted: Jan 9, 2007 3:32 PM) suggests checking the java path on the XI machine

This is JAVA_HOME=C:\j2sdk1.4.2_08 and seems ok

<b>Question</b>

Do you know why I would get the compilation error?

Any assistance would be appreciated

Regards,

Mike

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mike -

<i>>>>I want to access the DCJMS* variables but am not sure how to go about it as the

variables exist in the <SOAP:Header>?</i>

ASMA (Adapter Specific Message Attributes/Dynamic Configuration) can be <i>accessed</i> in routing and mapping. In mapping, you can also manipulate/set these attributes.

<i>>>>Do I use message mapping to extract the DCJMS* variables?</i>

You can use all three of the main mapping methods (message mapping, java, xslt) to extract your DCJMS* variables that are in the message header.

<i>>>>If so then which message is used for the source message so that I can access the <SOAP:Header>? Eg do I use the response message type or is there a trick to accessing the SOAP:Header?</i>

Once the attributes are populated in the message header, it doesn't matter really which source you choose since the attributes are in the message header, not the payload.

<i>>>>Do I use the user-defined function (like above)?</i>

You UDF code looks good to return the value for "DCJMSMessageID". You could throw in another parameter (e.g. variable to represent specific DCJMS property) to the UDF so that you can reuse it for other DCJMS* properties).

Regarding the compilation error, not sure, especially since you mentioned the UDF is not in play. Try taking it out of the mapping completely to isolate it to the UDF or not.

Regards,

Jin

Former Member
0 Kudos

Thanks for the response Jin

I can see these attributes in my JMS response message in the SOAP:Header as provided in my initial query

I am then using the response message type as the source message for my message mapping. From within the graphical editor all I can see are the payload tags of the response message. I cannot see any of the SOAP:Header --> SAP:DynamicConfiguration fields

So what node would I use on the (LHS) source message to connect to the user-defined function? The output is fine as I can then point the UDF result to a target (RHS) acknowledgement message type

Regards,

Mike

Former Member
0 Kudos

Hi Mike -

The graphical mapping tool (and any other mapping method - java, xslt) only works with the payload, since that's the actual business document. You won't be able to see the DynamicConfiguration fields/elements.

<i>>>>So what node would I use on the (LHS) source message to connect to the user-defined function?</i>

What node you use in the source is irrelevant. It's where you want to put the result of the UDF within the target structure that you should evaluate.

Regards,

Jin

Answers (2)

Answers (2)

Former Member
0 Kudos

Jin,

Apologies as I thought this update was sent a few days ago (must not have saved it). The issue is now resolved

<b>Response from SAP</b>

we found out that you are using an optional source message

in the Message Mapping " AWB0020_MM_MARKET_DATA_ACK".

You have specified in the Message Mapping editor

that the source message occurence is 0..1.

Therefore the reading of the dynamic configuration

does not work. In the multi-mapping case (which is switched

on also for optional messages) the reading of the dynamic configuration

attributes is not supported.

We suggest to turn the occurence back to 1..1 (you can

do this on the "Messages" tab of the Message-Mapping editor).

Afterwards you have to specify the mapping definition again.

Regards,

Mike

bhavesh_kantilal
Active Contributor
0 Kudos

Mike,

><i>In the multi-mapping case (which is switched

on also for optional messages) the reading of the dynamic configuration

attributes is not supported.</i>

Useful info. thanks for updating.

Regards

Bhavesh

Former Member
0 Kudos

Jin,

My compilation issue has gone via a SAP recommendation to specify the JDK home directory in the instance profile

Back to the mapping - I can now run my scenario

<b>Source message</b>

The response message has the following <SOAP:Header> from which I want to extract the DCJMSCorreleationID (note that it's misspelt)

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Response

-->

- <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSCorreleationID">40D982A0-B19D-11DB-9508-0002A5D5916B</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSTimestamp">1170297456940</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSMessageID">ID:414d5120514d4430312020202020202045c12b962001dd02</SAP:Record>

</SAP:DynamicConfiguration>

<b>Grahpical mapping</b>

LHS - Response message with occurrance 0..1 so it is not connected to my UDF

UDF Get_Corrid with no inputs

RHS - The UDF output is connected to the Acknowledgement msg tag <ACK>

<b>UDF</b>

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get

(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create

("http://sap.com/xi/XI/System/JMS","DCJMSCorreleationID");

String Corrid = conf.get(key);

return Corrid;

<b>Target message</b>

The idea is to copy the correlation id of the response message into the acknowledgement message. But as you can see the result is NULL

<?xml version="1.0" encoding="utf-8" ?>

- <ns2:AWB0020_MARKET_DATA_RESPONSE_ACK xmlns:ns2="http://awb.com.au/mq/tx/MarketData">

<ACK>null</ACK>

</ns2:AWB0020_MARKET_DATA_RESPONSE_ACK>

Please advise

Thanks Mike

Former Member
0 Kudos

Hi Mike -

I cut and paste your exact UDF code and it worked fine for me, so it's definitely not your UDF code. Here's what else I had:

<b>DynamicConfiguration in header</b>

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<!-- Request Message Mapping -->

<SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSTimestamp">1170949507708</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/JMS" name="DCJMSCorreleationID">d8721e9f-0452-004d-a557-55b6082e5d9a</SAP:Record>

</SAP:DynamicConfiguration>

<b>Payload before mapping</b>

<?xml version="1.0" encoding="utf-8"?>

<nr1:Demo1 xmlns:nr1="http://demo.com/xi/proxy">

<ItemNo>00005</ItemNo>

<Data>TEST</Data>

</nr1:Demo1>

<b>Payload after mapping</b>

<?xml version="1.0" encoding="UTF-8"?>

<ns0:Demo1 xmlns:ns0="http://demo.com/xi/proxy">

<ItemNo>00005</ItemNo>

<Data>d8721e9f-0452-004d-a557-55b6082e5d9a</Data>

</ns0:Demo1>

Obviously, the UDF is applied on the <Data> field.

Just to confirm, please make sure the correct interface mapping and mapping is configured in your interface determination.

Also, I was using an NW04/SP19 system (roughly NW04s/SP10).

Regards,

Jin