Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Headers not set in ITI43 component?

27 views
Skip to first unread message

Sergio Juan Membiela

unread,
Aug 25, 2022, 7:10:47 AM8/25/22
to ipf-user
Hi.

I have a small client program that sends ITI-18 and ITI-43 requests to a server.

ITI-18 requests work well, but ITI-43 requests fail.

I did not have much support from the server side technicians, and since it is HTTPS I cannot sniff the HTTP. I have added OutPayloadLoggerInterceptor to see the requests, I have added them at the end.

Troubleshooting with postman shows me that I can replicate the error if I disable sending either the "Host" or "Content-Length" headers.

Both ITI-18 and ITI-43 requests from postman fail if I do not send either of the headers.

That seems to imply that the ITI-43 component is not sending one or both of those headers:

* Is my assessment correct?
* How can I manually set those headers?

This is my code:

    public void query(final String patientId) {
        var query = new FindDocumentsQuery();
        query.setPatientId(new Identifiable(patientId, new AssigningAuthority("2.16.724.4.4.5.200.50.200")));
        var status = new ArrayList<AvailabilityStatus>();
        status.add(AvailabilityStatus.APPROVED);
        query.setStatus(status);
        var queryRegistry = new QueryRegistry(query);
        queryRegistry.setReturnType(QueryReturnType.LEAF_CLASS);
        var exchange = new DefaultExchange(camelContext);
        exchange.getIn().setBody(queryRegistry);
        var endpoint = this.environment.getRequiredProperty("bdac.endpoint.iti18");
        try (var template = camelContext.createProducerTemplate()) {
            var result = template.send(endpoint, exchange);

            if (result.getException() != null) {
                throw result.getException();
            }
            var response = result.getMessage().getBody(QueryResponse.class);
            LOG.warn("Resultado {}", response.toString());
        } catch (Exception e) {
            LOG.error("Excepción buscando informes", e);
            throw new RuntimeException("Excepción buscando informes en BDAC", e);
        }
    }

    public void retrieve(final String documentUri) {
        var repositoryUniqueId = this.environment.getRequiredProperty("bdac.repository.id");
        var documentReference = new DocumentReference(repositoryUniqueId, documentUri, null);
        var retrieveDocumentSet = new RetrieveDocumentSet();
        retrieveDocumentSet.getDocuments().add(documentReference);
        var exchange = new DefaultExchange(camelContext);
        exchange.getIn().setBody(retrieveDocumentSet);
        var endpoint = this.environment.getRequiredProperty("bdac.endpoint.iti43");
        try (var template = camelContext.createProducerTemplate()) {
            var result = template.send(endpoint, exchange);

            if (result.getException() != null) {
                throw result.getException();
            }
            var response = result.getMessage().getBody(RetrieveDocumentSet.class);
            LOG.warn("Resultado {}", response.toString());
        } catch (Exception e) {
            LOG.error("Excepción buscando informes", e);
            throw new RuntimeException("Excepción buscando informes en BDAC", e);
        }
    }

This is the outlogger capture for ITI-18

Target endpoint: https://[REDACTED]/xds-iti18
Character set: UTF-8

Accept: */*
Authorization: Basic [REDACTED]

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><Action soap:mustUnderstand="true" xmlns="http://www.w3.org/2005/08/addressing">urn:ihe:iti:2007:RegistryStoredQuery</Action><MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:dd0e2f06-2d57-4054-9183-4027a7af6aa5</MessageID><To xmlns="http://www.w3.org/2005/08/addressing">https://val-engine-bdac.ssib.es/xds-iti18</To><ReplyTo xmlns="http://www.w3.org/2005/08/addressing"><Address>http://www.w3.org/2005/08/addressing/anonymous</Address></ReplyTo></soap:Header><soap:Body><ns4:AdhocQueryRequest xmlns:ns6="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0" xmlns:ns5="urn:ihe:iti:xds-b:2007" xmlns:ns4="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"><ns4:ResponseOption returnType="LeafClass" returnComposedObjects="true"/><ns2:AdhocQuery id="urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d"><ns2:Slot name="$XDSDocumentEntryPatientId"><ns2:ValueList><ns2:Value>'38511601445^^^&amp;2.16.724.4.4.5.200.50.200&amp;ISO'</ns2:Value></ns2:ValueList></ns2:Slot><ns2:Slot name="$XDSDocumentEntryStatus"><ns2:ValueList><ns2:Value>('urn:oasis:names:tc:ebxml-regrep:StatusType:Approved')</ns2:Value></ns2:ValueList></ns2:Slot></ns2:AdhocQuery></ns4:AdhocQueryRequest></soap:Body></soap:Envelope>

This is the outlogger capture for the ITI-43

Target endpoint: https://[REDACTED]/xds-iti43
Character set: UTF-8

Accept: */*
Authorization: Basic [REDACTED]


--uuid:cae3b7eb-da6d-4286-b844-7bb442501a53
Content-Type: application/xop+xml; charset=UTF-8; type="application/soap+xml"
Content-Transfer-Encoding: binary
Content-ID: <root.m...@cxf.apache.org>

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><Action soap:mustUnderstand="true" xmlns="http://www.w3.org/2005/08/addressing">urn:ihe:iti:2007:RetrieveDocumentSet</Action><MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:72b7cbf3-60c3-426e-9496-3b14cb0642d2</MessageID><To xmlns="http://www.w3.org/2005/08/addressing">https://val-engine-bdac.ssib.es/xds-iti43</To><ReplyTo xmlns="http://www.w3.org/2005/08/addressing"><Address>http://www.w3.org/2005/08/addressing/anonymous</Address></ReplyTo></soap:Header><soap:Body><ns2:RetrieveDocumentSetRequest xmlns:ns7="urn:ihe:iti:rmd:2017" xmlns:ns6="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0" xmlns:ns5="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:ns4="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:ns2="urn:ihe:iti:xds-b:2007"><ns2:DocumentRequest><ns2:RepositoryUniqueId>1.3.6.1.4.1.19376</ns2:RepositoryUniqueId><ns2:DocumentUniqueId>urn:uuid:22771c52-e2f4-46e6-8530-61636815ce25</ns2:DocumentUniqueId></ns2:DocumentRequest></ns2:RetrieveDocumentSetRequest></soap:Body></soap:Envelope>
--uuid:cae3b7eb-da6d-4286-b844-7bb442501a53--

Sergio Juan Membiela

unread,
Aug 26, 2022, 5:08:22 AM8/26/22
to ipf-user
Hi.

I have continued experimenting; I have download and compiled the XDS repository from the github tutorial and now I can sniff the requests.

Turns out the Host and Content-Length are correctly set both in ITI-18 and ITI-43, the main difference seems to be in the Content-Type header

ITI-18 (works)
Hypertext Transfer Protocol
    POST /xds-iti18 HTTP/1.1\r\n
    Content-Type: application/soap+xml; charset=UTF-8\r\n
    Accept: */*\r\n
    User-Agent: Apache-CXF/3.5.2\r\n
    Cache-Control: no-cache\r\n
    Pragma: no-cache\r\n
    Host: localhost:9091\r\n
    Connection: keep-alive\r\n
    Content-Length: 1374\r\n
    \r\n
    [Full request URI: http://localhost:9091/xds-iti18]
    [HTTP request 1/2]
    [Response in frame: 8]
    [Next request in frame: 12]
    File Data: 1374 bytes


ITI-43 (fails)
Hypertext Transfer Protocol
    POST /xds-iti43 HTTP/1.1\r\n
    Content-Type: multipart/related; type="application/xop+xml"; boundary="uuid:56bd7e7a-4591-4c4b-909f-34f3b199147e"; start="<root.m...@cxf.apache.org>"; start-info="application/soap+xml"\r\n
    Accept: */*\r\n
    User-Agent: Apache-CXF/3.5.2\r\n
    Cache-Control: no-cache\r\n
    Pragma: no-cache\r\n
    Host: localhost:9091\r\n
    Connection: keep-alive\r\n
    Content-Length: 1396\r\n
    \r\n
    [Full request URI: http://localhost:9091/xds-iti43]
    [HTTP request 2/2]
    [Prev request in frame: 6]
    [Response in frame: 14]
    File Data: 1396 bytes

Is there any way I can force ITI-43 to send Content-type as "application/soap+xml; charset=UTF-8"?

Best regards

Dmytro Rud

unread,
Aug 26, 2022, 6:11:26 AM8/26/22
to ipf-...@googlegroups.com
I suppose you could change the header content in a CXF interceptor... 


--
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/71444d66-b5be-4d47-adc7-7417525ad037n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages