Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ESBJAVA-5138 #831

Merged
merged 1 commit into from Jul 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -71,6 +71,11 @@ public class SAPTransportSender extends AbstractTransportSender {
*/
public static final int SAP_TRANSPORT_ERROR = 8000;

/**
* String constant for the header name of sap transaciton id.
*/
public static final String SAP_TRANSACTION_ID = "SAP-Transaction-Id";

/**
* SAP destination error. Possibly something wrong with the remote R/* system
*/
Expand Down Expand Up @@ -131,8 +136,15 @@ public void sendMessage(MessageContext messageContext, String targetEPR,
IDocRepository iDocRepository = JCoIDoc.getIDocRepository(destination);
String tid = destination.createTID();
IDocDocumentList iDocList = getIDocs(messageContext, iDocRepository);

//Set the transaction id as a transport header so that it can be used later.
Object headers = messageContext.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
Map headersMap = (Map) headers;
headersMap.put(SAP_TRANSACTION_ID, tid);

JCoIDoc.send(iDocList, getIDocVersion(uri), destination, tid);
destination.confirmTID(tid);

} else if (uri.getScheme().equals(SAPConstants.SAP_BAPI_PROTOCOL_NAME)) {
try {
OMElement payLoad,body;
Expand Down