Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,26 @@ public Map<String, Object> sendMessage(Map<String, Object> inputDict, RestReques
if (fromPartyId == null) {
return errorObject;
}
String fromRole = listener.getStringFromInput(inputDict, "from_role", errorObject);
if (fromRole == null) {
fromRole = "";
}
String toPartyId = listener.getStringFromInput(inputDict, "to_party_id", errorObject);
if (toPartyId == null) {
return errorObject;
}
String toRole = listener.getStringFromInput(inputDict, "to_role", errorObject);
if (toRole == null) {
toRole = "";
}
String conversationId = listener.getStringFromInput(inputDict, "conversation_id", errorObject);
if (conversationId == null) {
return errorObject;
}
String serviceType = listener.getOptionalStringFromInput(inputDict, "service_type", null, errorObject);
String fromPartyIdType = listener.getOptionalStringFromInput(inputDict, "from_party_id_type", null, errorObject);
String toPartyIdType = listener.getOptionalStringFromInput(inputDict, "to_party_id_type", null, errorObject);


List<byte[]> payloads = new ArrayList<byte[]>();
if (inputDict.containsKey("payload")) {
Expand Down Expand Up @@ -120,9 +132,14 @@ else if (inputDict.containsKey("payloads")) {
}
}

ApiPlugin.core.log.debug("Parameters: partnership_id=" + partnershipId + ", from_party_id=" + fromPartyId +
", to_party_id=" + toPartyId + ", conversation_id=" + conversationId +
", number of payloads=" + payloads.size());
ApiPlugin.core.log.debug("Parameters: partnership_id=" + partnershipId +
", from_party_id=" + fromPartyId + ", from_role=" + fromRole +
", to_party_id=" + toPartyId + ", to_role=" + toRole +
", conversation_id=" + conversationId +
", service_type=" + serviceType +
", from_party_id_type=" + fromPartyIdType +
", to_party_id_type=" + toPartyIdType +
", number of payloads=" + payloads.size());

EbmsRequest ebmsRequest;
String messageId = Generator.generateMessageID();
Expand All @@ -138,11 +155,20 @@ else if (inputDict.containsKey("payloads")) {
MessageHeader msgHeader = ebxmlMessage.addMessageHeader();

msgHeader.setCpaId(partnershipDVO.getCpaId());
msgHeader.setConversationId(conversationId);
msgHeader.setService(partnershipDVO.getService());
msgHeader.setAction(partnershipDVO.getAction());
msgHeader.addFromPartyId(fromPartyId);
msgHeader.addToPartyId(toPartyId);
msgHeader.setConversationId(conversationId);
if (serviceType != null && !serviceType.equals("")) {
msgHeader.setServiceType(serviceType);
}
if (fromRole != "") {
msgHeader.setFromRole(fromRole);
}
msgHeader.addFromPartyId(fromPartyId, fromPartyIdType);
if (toRole != "") {
msgHeader.setToRole(toRole);
}
msgHeader.addToPartyId(toPartyId, toPartyIdType);
msgHeader.setMessageId(messageId);
msgHeader.setTimestamp(EbmsUtility.getCurrentUTCDateTime());

Expand Down