Skip to content

Commit

Permalink
Merge pull request #70 from IZIVIA/feat-EVSIM-437-add-message-id-in-r…
Browse files Browse the repository at this point in the history
…equest-metadata

feat: EVSIM-437 add message id in request metadata
  • Loading branch information
DeborahPereira4sh authored Apr 26, 2024
2 parents 3166126 + 7b5aa5c commit 1ccfe54
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class OcppSoapServerTransport private constructor(
msg.action?.lowercase() == action.lowercase()
) {
val message = ocppSoapParser.parseRequestFromSoap(msg.payload, clazz)
val response = onAction(RequestMetadata(message.messageId), message.payload)
val response = onAction(RequestMetadata(message.chargingStationId, message.messageId), message.payload)
val payload = ocppSoapParser.mapResponseToSoap(
ResponseSoapMessage(
messageId = "urn:uuid:${newMessageId()}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ class WebsocketServer(
val parser = getJsonMapper(OcppVersionWamp.valueOf(ocppVersion.name))
try {
val response =
onAction(RequestMetadata(meta.ocppId), parser.parsePayloadFromJson(msg.payload, clazz))
onAction(
RequestMetadata(meta.ocppId, msg.msgId),
parser.parsePayloadFromJson(msg.payload, clazz)
)
val payload = parser.mapPayloadToString(response)
WampMessage.CallResult(msg.msgId, payload)
} catch (e: Exception) { // TODO Better mapping of exceptions https://izivia.atlassian.net/browse/IDEV-497
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.izivia.ocpp.operation.information

data class RequestMetadata(
val chargingStationId: String
val chargingStationId: String,
val messageId: String? = null
)

0 comments on commit 1ccfe54

Please sign in to comment.