Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IDEA] Get HTTP Headers in a WebServiceListener Connector #6337

Open
nbssrl opened this issue Oct 31, 2024 · 0 comments · Fixed by nkzarrabi/connect#1 · May be fixed by #6339
Open

[IDEA] Get HTTP Headers in a WebServiceListener Connector #6337

nbssrl opened this issue Oct 31, 2024 · 0 comments · Fixed by nkzarrabi/connect#1 · May be fixed by #6339
Labels
enhancement New feature or request

Comments

@nbssrl
Copy link

nbssrl commented Oct 31, 2024

Problem

I have a connector in mirth 4.3.0 of type Web Service Listener.
This connector does not allow me to display the HTTP Headers of incoming calls.

Code

@WebService(name = "PS118Service", targetNamespace = "http://ws.ps118.area118.eng.it/")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@XmlSeeAlso({
        ObjectFactory.class
})
public class ServiziAreas118 extends AcceptMessage {
    public ServiziAreas118(WebServiceReceiver webServiceReceiver) {
        super(webServiceReceiver);
    }

    @WebMethod(action = "savePatientPSRequest")
    @WebResult(name = "savePatientPSResponse", targetNamespace = "http://ws.ps118.area118.eng.it/",  partName = "savePatientPSResponse")
    public SavePatientPSResponseType savePatientPSRequest(
            @WebParam(name = "pat", targetNamespace = "http://ws.ps118.area118.eng.it/", partName = "pat")
            PatientPsWeb118 patientPsWeb118){
        HashMap<String, String> mirthResponse = parseMirthResponse(super.webServiceReceiver.processData(patientMarshalling(patientPsWeb118)));
        ServiceResult serviceResult = new ServiceResult();
        serviceResult.setError(Boolean.parseBoolean(mirthResponse.get("error")));
        serviceResult.setMessage(mirthResponse.get("message"));
        SavePatientPSResponseType savePatientPSResponse = new SavePatientPSResponseType();
        savePatientPSResponse.setReturn(serviceResult);
        return savePatientPSResponse;
    }

Mirth WS Listener Configuration

Screenshot 2024-10-31 alle 5 50 51 PM

What i have (only Soap Body Mapping)

Screenshot 2024-10-31 alle 5 53 28 PM

What i wish i had

Screenshot 2024-10-31 alle 5 52 58 PM

Bonus Question

How can I handle soap faults? Even if I use a throw in the channel, the status of the call remains 200 (in a standard java ws this would be enough to get a 500).

Thank you all for your help.

@nbssrl nbssrl added the enhancement New feature or request label Oct 31, 2024
nkzarrabi added a commit to nkzarrabi/connect that referenced this issue Nov 4, 2024
Fixes nextgenhealthcare#6337

Add functionality to display HTTP Headers in Web Service Listener connector.

* **WebServiceListener.java**:
  - Add `httpHeadersField` to display HTTP Headers.
  - Update `initComponents` to initialize `httpHeadersField`.
  - Update `initLayout` to add `httpHeadersField` to the layout.
  - Update `setProperties` and `getProperties` methods to handle HTTP Headers.

* **IWebServiceReceiver.java**:
  - Add `getHttpHeaders` method to the interface.

* **WebServiceConfiguration.java**:
  - Add `configureHttpHeaders` method to handle HTTP Headers.

* **WebServiceReceiver.java**:
  - Add `httpHeaders` field to store HTTP Headers.
  - Implement `getHttpHeaders` method to return HTTP Headers.
  - Update `createAuthenticator` method to store HTTP Headers from `HttpExchange`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/nextgenhealthcare/connect/issues/6337?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant