johnperry / CTP

Clinical Trial Processor
http://mircwiki.rsna.org/index.php?title=CTP_Articles
65 stars 55 forks source link

HttpExportService for Connection to XNAT Servers doesn't work with XNAT v1.8.5.x #32

Closed fxusyd closed 1 year ago

fxusyd commented 1 year ago

Hi all,

HttpExportService for Connection to XNAT Servers doesn't work with XNAT v1.8.5.x. Connection is established, but data can't be imported into XNAT.

Got the below error in the CTP log:

20:32:22 WARN [HttpExportService] Unable to read response: Server returned HTTP response code: 400 for URL: https://xxxx:443/data/services/import?import-handler=DICOM-zip&inbody=true 20:32:22 WARN [AbstractExportService] HttpExportService: Unable to export roots/HttpExportService/active/QF-12676001528587256474

Below is the configuration for HttpExportService:

<HttpExportService
    acceptXmlObjects="no"
    acceptZipObjects="no"
    class="org.rsna.ctp.stdstages.HttpExportService"
    name="HTTPS Export to XNAT"
    quarantine="roots/HttpExportService/quarantines"
    root="roots/HttpExportService"
    sendDigestHeader="yes"
    url="https://xxxx:443/data/services/import?import-handler=DICOM-zip&inbody=true">
    <compressor
        cacheSize="100"
        defaultString="unknown"
        structure="(0010,0020).(0008,0060).(0008,0020).(0008,0030).(0020,0011).(0020,0013).(0019,10A2)"/>
    <xnat
        cookieName="JSESSIONID"
        password="blah"
        url="https://xxxx:443/data/JSESSION"
        username="blah"/>
</HttpExportService>

Using the same CTP configuration but connects to another XNAT of version 1.7.x, the import is successful.

fxusyd commented 1 year ago

Found the workaround. After XNAT v1.8.2.x, contentType needs to be set specifically to 'application/zip' for DICOM-zip import handler.