on 2014 May 22 11:19 AM
Hello,
Could you please let me know how can we retrieve following parameters in custom adapter module?
Message size
Message Mapping name
Operation Mapping name
Sender and Receiver Interface names
Thanks!
Regards,
Shweta
Request clarification before answering.
Hi Shweta
Not all the information is available directly from the adapter module.
Message size
Retrieve the input stream of the payload, convert the stream to bytes and count the bytes length.
Message msg = (Message) inputModuleData.getPrincipalData();
XMLPayload payload = msg.getDocument();
InputStream inStr = payload.getInputStream();
// Convert inStream to bytes
int size = bytes.length;
Sender and Receiver interface names
You can only get Sender interface in sender module, and receiver interface in receiver module. You can get the from the getAction() method.
Message msg = (Message) inputModuleData.getPrincipalData();
String interfaceName = msg.getAction().getName();
Operation Mapping name
This is not directly available from the Adapter Framework. One workaround is to access this via the Integration Directory API. With the Interface Determination Service API, you can read the Interface Determination object to get the associated mapping. To do this you have to make a SOAP call to the API.
Message Mapping name
I'm not sure how this can be retrieved as this is only available in ESR.
If the module is on the receiver side, another option is to extract the information during mapping and store it into Dynamic Configuration, then in the receiver module, to extract it from Dynamic Configuration.
Rgds
Eng Swee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eng,
Thanks a lot for the details.
The problem with message size with this approach is, the value we get is totally different from the one we see in Message Monitoring under Message Details tab.
For example, I get 562 when under Message Details tab, its 6638.
Not sure, where this difference come from.
Regards,
Shweta
Hi Shweta
Unfortunately, I am not aware of any way to get the whole SOAP header and body. The JavaDocs for Message does not seem to list any methods to retrieve the whole SOAP section, only specific header fields.
During runtime, the module has access to only 1 message, either the request or the response. If you want both, you will need to have a module before the adapter call is executed (to get request size) and another after the adapter is executed (to get the response size.)
Rgds
Eng Swee
User | Count |
---|---|
60 | |
10 | |
8 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.