usnistgov / iheos-toolkit2

XDS Toolkit
https://ihexds.nist.gov
45 stars 25 forks source link

Improve error response to requesting systems that send a non-mtom ITI-41 message #581

Closed tonesoutherland closed 1 year ago

tonesoutherland commented 1 year ago

When sending a non-MTOM XDS/XDR ITI-41 request to the simulator a fault exception is returned with a stack trace that does not indicate what the issue is. The XDS simulator tool is behaving correctly since MTOM is required for XD* transactions, however the response needs to be more clear, indicating that the requester is sending a non-MTOM request.

This was discovered testing at the 2023 NA Connectathon in Austin.

See attached files.

ITI-41-non-mtom.txt ITI-41-non-mtom-fault-exceptoin.txt

andrewmccaffreynist commented 1 year ago

Mitigated in BUGFIX/NonMTOMITI41Message581 branch. Xds Toolktit response to message contained in ITI-41-non-mtom.txt is now:

HTTP/1.1 200 Content-Type=multipart/related; boundary=MIMEBoundary112233445566778899; type="application/xop+xml"; start="doc0@ihexds.nist.gov"; start-info="application/soap+xml" Content-Length=991 Date=Tue, 02 May 2023 14:24:21 GMT Keep-Alive=timeout=20 Connection=keep-alive

--MIMEBoundary112233445566778899

Content-Type: application/xop+xml; charset=UTF-8; type="application/soap+xml" Content-Transfer-Encoding: binary Content-ID: doc0@ihexds.nist.gov

urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-bResponse</wsa:Action>urn:uuid:55053580-39cc-476f-9d89-31ef1cbb2599</wsa:RelatesTo></S:Header>fault:Sender</fault:Value></fault:Code>Header/Format Validation errors reported by HttpMessageValidator

Expected [Multipart] Found [ SIMPLE Format] </fault:Text></fault:Reason></fault:Fault></S:Body></S:Envelope>

--MIMEBoundary112233445566778899--

skbhaskarla commented 1 year ago

BUGFIX/NonMTOMITI41Message581 merged to develop branch.