Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

How to log Web Service Message When I act as ihe-client

18 views
Skip to first unread message

文波

unread,
Feb 26, 2024, 11:16:21 PM2/26/24
to ipf-user
Hi Everyone
I read the ipf-docs about File-based Logging of Web Service Message Payload  It works nicely in XDS server. I want to know if I can still log the sent Web Service messages to a file when I act as a client of XDS. If so, how can I do it? For example, when sending an ITI18 query transaction, can I use org.openehealth.ipf.commons.ihe.ws.cxf.payload to log the sent Web Service messages to a local file? Thank you very much for your help.
Best Regards
BoVane

Dmytro Rud

unread,
Feb 27, 2024, 1:46:01 AM2/27/24
to ipf-...@googlegroups.com
Hi BoVane

On the client side, the file-based payload logging works absolutely in the same way as on the server side.  Only the directions are changed -- e.g., a request would be an outgoing message of the client, but an incoming message for the server.

Best regards
Dmytro
 

--
You received this message because you are subscribed to the Google Groups "ipf-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ipf-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ipf-user/ff431eeb-b6b5-4ab2-b2f8-eee8dc8805b7n%40googlegroups.com.

文波

unread,
Feb 27, 2024, 1:54:01 AM2/27/24
to ipf-...@googlegroups.com
Hi Dmytro
Long time no see. I know the data flow is in the opposite direction, but I am not sure how to invoke the file-based payload logging on the client side. Could you give me some code hints? I seem to have not seen any documentation on invoking it on the client side. Thank you very much for your help.
Best Regards
BoVane

Dmytro Rud <dmytr...@gmail.com> 于2024年2月27日周二 14:46写道:

文波

unread,
Feb 27, 2024, 2:08:56 AM2/27/24
to ipf-...@googlegroups.com
My xds-iti41 client codes are as follows, But how can I add the the file-based payload logging ? 😀
// initialization of the application -- should be executed only once
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext("context-client.xml");
CamelContext camelContext = appContext.getBean(CamelContext.class);
ProducerTemplate producerTemplate = appContext.getBean(ProducerTemplate.class);

// for each call
Exchange exchange = new DefaultExchange(camelContext);
exchange.setPattern(ExchangePattern.InOut);
// send the xds-iti41 request
exchange.getIn().setBody(provide);
String iti41Endpoint = "xds-iti41://localhost:9091/xds-iti41";

exchange = producerTemplate.send(iti41Endpoint, exchange);
Exception exception = Exchanges.extractException(exchange);
if (exception != null) {
throw exception;
}
Response response1 = exchange.getMessage().getMandatoryBody(Response.class);
log.warn(response1.toString());

文波 <bova...@gmail.com> 于2024年2月27日周二 14:53写道:

文波

unread,
Feb 27, 2024, 2:12:26 AM2/27/24
to ipf-...@googlegroups.com
My Client context.xml are as follows

文波 <bova...@gmail.com> 于2024年2月27日周二 15:08写道:
context-client.xml

Dmytro Rud

unread,
Feb 27, 2024, 2:16:45 AM2/27/24
to ipf-...@googlegroups.com
Simply add interceptors to the endpoint URL as shown below.


On Tue, Feb 27, 2024 at 8:08 AM 文波 <bova...@gmail.com> wrote:
My xds-iti41 client codes are as follows, But how can I add the the file-based payload logging ? 😀
// initialization of the application -- should be executed only once
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext("context-client.xml");
CamelContext camelContext = appContext.getBean(CamelContext.class);
ProducerTemplate producerTemplate = appContext.getBean(ProducerTemplate.class);

// for each call
Exchange exchange = new DefaultExchange(camelContext);
exchange.setPattern(ExchangePattern.InOut);
// send the xds-iti41 request
exchange.getIn().setBody(provide);
String iti41Endpoint = "xds-iti41://localhost:9091/xds-iti41"
       + "?inInterceptors=#clientInLogger" +
         "&inFaultInterceptors=#clientInLogger" +
         "&outInterceptors=#clientOutLogger";  

文波

unread,
Feb 27, 2024, 2:43:20 AM2/27/24
to ipf-user
Hi Dmytro
It works !! 😊😊 The IPF you developed is really convenient, but I am not familiar with the framework and my development skills are insufficient. I want to add support for ATNA, how should I do it? I remember you mentioned last time that "For compliance with the IHE ATNA profile (audit trail), you have to add Audit Record Repository parameters to the bean 'auditContext' in context.xml." Currently, I am using the server provided in your XDS tutorial as the XDS server code without any modifications. How should I add audit support? Should I configure the audit in the server's context.xml or in the client's context-client.xml? Is there any documentation available? Or perhaps there is some code available. I don't need a very complex ATNA, just need to meet the simplest audit requirements for IHE testing. I am truly very grateful to you. I couldn't have made progress without your help.
Best Regards
BoVane

Dmytro Rud

unread,
Feb 27, 2024, 2:48:36 AM2/27/24
to ipf-...@googlegroups.com
You need ATNA configuration on both the client and on the server sides.  Add the following bean definition to the corresponding Spring context descriptor:

<bean id="auditContext" class="org.openehealth.ipf.commons.audit.DefaultAuditContext">
<property name="auditEnabled" value="true"/>
<property name="auditSourceId" value="sourceId"/>
<property name="auditMessageQueue" ref="mockedSender"/>
<!-- default
<property name="auditRepositoryHost" value="localhost"/>
<property name="auditRepositoryPort" value="514"/>
<property name="auditRepositoryTransport" value="UDP"/>
-->
</bean>

Take a look at the class DefaultAuditContext to discover which other parameters can be configured in this way.


bovane.ch

unread,
Feb 27, 2024, 2:55:29 AM2/27/24
to ipf-user
you means as long as I configure the ATNA configuration on both the
client and on the server sides, The IPF framework can automatically
implement the required ATNA for IHE? Besides configuration, do I need
to do anything else? How can I check if ATNA is working? Do I need to
look at the console output when starting the project?

On 1970年1月1日星期四 08:00, wrote:

> You need ATNA configuration on both the client and on the server sides. Add the following bean definition to the corresponding Spring context descriptor: Take a look at the class DefaultAuditContext to discover which other parameters can be configured in this way. To view this discussion on the web visit https://groups.google.com/d/msgid/ipf-user/CAHh9K-mDiAnUoetua5DTW4cvxhn%3D3HSOiJmA3cJRXkKHUGEcvw%40mail.gmail.com.

Dmytro Rud

unread,
Feb 27, 2024, 3:06:14 AM2/27/24
to ipf-...@googlegroups.com
Yes, IPF implements ATNA already.  In order to see the payload of ATNA records, you can set the "auditMessageQueue" to an instance of org.openehealth.ipf.commons.audit.queue.LoggingAuditMessageQueue or org.openehealth.ipf.commons.audit.queue.RecordingAuditMessageQueue, or enable log level TRACE for org.openehealth.ipf.commons.audit.protocol.

--
You received this message because you are subscribed to the Google Groups "ipf-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ipf-user+u...@googlegroups.com.
Message has been deleted

文波

unread,
Feb 27, 2024, 3:20:07 AM2/27/24
to ipf-user
My ATNA configurations are as follows both on the client and server sides, I start the server then test ITI41 & ITI18, How can I check if ATNA is working?  Do I need to look at the console output when starting the project? I want to know what ATNA looks like so I can be sure the configuration works

<!-- Auditing -->
<bean id="auditContext" class="org.openehealth.ipf.commons.audit.DefaultAuditContext">
<property name="auditEnabled" value="true"/>
<property name="auditSourceId" value="sourceId"/>
<property name="auditMessageQueue" ref="mockedSender"/>
<!-- default
<property name="auditRepositoryHost" value="localhost"/>
<property name="auditRepositoryPort" value="514"/>
<property name="auditRepositoryTransport" value="UDP"/>
-->
</bean>

<bean id="mockedSender" class="org.openehealth.ipf.commons.audit.queue.RecordingAuditMessageQueue"/>

Dmytro Rud

unread,
Feb 27, 2024, 3:22:10 AM2/27/24
to ipf-...@googlegroups.com
You can check the contents of org.openehealth.ipf.commons.audit.queue.RecordingAuditMessageQueue#getMessages.

文波

unread,
Feb 27, 2024, 3:43:40 AM2/27/24
to ipf-user
Thank you very much I just use LoggingAuditMessageQueue instead of RecordingAuditMessageQueue,then I can see <AuditMessage> in console !!! 😄😄By the way, if I use RecordingAuditMessageQueue as the ATNA configuration, how should I retrieve List<AuditMessage> through the getMessages() method? For example, if I need to retrieve it in the IHE client, how do I call the getMessages() method? This part is not very clear to me.

Dmytro Rud

unread,
Feb 27, 2024, 3:55:00 AM2/27/24
to ipf-...@googlegroups.com
Do you mean that your client has to retrieve audit records from the Audit Record Repository?  In this case, the client (and the Audit Record Repository) would have to implement ITI-81 or ITI-82.  ITI-81 is supported ny IPF, ITI-82 not yet.

文波

unread,
Feb 27, 2024, 4:08:22 AM2/27/24
to ipf-user
When I wanna to see ITI-81 but the pages occur 404 
https://oehf.github.io/ipf/ipf-platform-camel-ihe-fhir-stu3-atna/iti81.html
截屏2024-02-27 16.59.42.png
Next Step I will study PIX2 in IHE, That's means I need implement ITI-8, ITI-9, ITI-10, Is there any reference for me ? Whether I should take a look ipf-tutorials-hl7 ?

Dmytro Rud

unread,
Feb 27, 2024, 4:27:49 AM2/27/24
to ipf-...@googlegroups.com
1. Yes, the ITI-81 component is not yet documented.  But it is known that the URI schema is "atna-iti81" and the URI parameters correspond to the IHE specification.
2. There is no specific tutorial for PIX/PDQ transactions, but you can take a look at documentation (https://oehf.github.io/ipf-docs/docs/ihe/hl7v2/) and unit tests (package org.openehealth.ipf.platform.camel.ihe.mllp).


Reply all
Reply to author
Forward
0 new messages