Announcement

Collapse
No announcement yet.

Which is the .class that generates the HTTP response

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Which is the .class that generates the HTTP response

    Hi all,

    We have deployed a WebService in our Mirth service, and due to a problem with the HTTP response header that Mirth is responding, we need to modify it. We need to change the Java that is constructing the header, but we don't know where is it.

    Does anyone can help us? thank you very much!

  • #2
    I know it's in the package com.webreach.mirth.connectors.http.transformers and the class is UMOMessageToHttpResponse, but i can't find in which .jar is.

    Comment


    • #3
      Out of curiosity what does the current header look like? What needs to be changed? Is this an error or is this something custom that you need to work in your environment?
      Jon Bartels

      Zen is hiring!!!!
      http://consultzen.com/careers/
      Talented healthcare IT professionals wanted. Engineers to sales to management.
      Good benefits, great working environment, genuinely interesting work.

      Comment


      • #4
        Hii,

        is in order to add the OK after the HTTP/200. The missing of the OK is making our integration not working.

        Comment


        • #5
          That may be part of the apache commons http-client. What would your app do with a second HTTP/1.1 200 OK ? like:
          SUCCESS: HTTP/1.1 200
          Connection: close
          Date: Tue, 26 Jan 2010 12:02:51 EST
          Server: Mule/1.2
          Expires: Tue, 26 Jan 2010 12:02:51 EST
          Content-Type: text/html
          Content-Length: 15
          X-MULE_CORRELATION_ID: a34099ab-0a9c-11df-bb6b-8b3855ecaeea
          X-MULE_CORRELATION_GROUP_SIZE: 2
          X-MULE_CORRELATION_SEQUENCE: -1
          HTTP/1.1 200 OK

          adding that could be done using responseMap.put

          Comment


          • #6
            Yes! That's what I need.

            I am new on Mirth, could you explain me what is responseMap.put and how to change it?

            Thank you very much!
            Ignasi

            Comment


            • #7
              responseMap is typically used to check the the response of a destination for example you can test the "status" of SUCCESS, FILTERED etc. You can also formulate your own responses. In your model you could simply change the HTTP listener connector property "Respond From" to a destination (Destination2 in my example) that you create that is a Channel writer then in the postprocessor script of the connector simply add the following:
              responseMap.put("Destination 2", ResponseFactory.getSuccessResponse("HTTP/1.1 200 OK"));

              Comment


              • #8
                I tried it but didn't work. My listener isn't HTTP, is SOAP.

                By doing as you said, I get the HTTP/1.1 200 OK as the response's payload, not the HTTP header.

                Comment


                • #9
                  This problem smells wrong. Theres a fairly common HTTP library generating headers and a SOAP interaction. Its a common task.

                  What is the basis for the other applications SOAP stack? .NET? Ruby? Java?
                  What library is it using for SOAP?
                  What library is it using for HTTP?
                  Is the error you get originating from your SOAP library or are you making a manual call to check the HTTP code? If you're making the call, what function are you using?

                  I suspect that there is either a bad call or a bad test for HTTP codes. Something is looking at the text for the code ('OK', 'BAD REQUEST', 'FORBIDDEN') instead of just reading the numeric code.
                  Jon Bartels

                  Zen is hiring!!!!
                  http://consultzen.com/careers/
                  Talented healthcare IT professionals wanted. Engineers to sales to management.
                  Good benefits, great working environment, genuinely interesting work.

                  Comment


                  • #10
                    I agree with JB

                    The "Reason Phrase" is not required by the client. See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html

                    6.1.1 Status Code and Reason Phrase
                    The Status-Code element is a 3-digit integer result code of the attempt to understand and satisfy the request. These codes are fully defined in section 10. The Reason-Phrase is intended to give a short textual description of the Status-Code. The Status-Code is intended for use by automata and the Reason-Phrase is intended for the human user. The client is not required to examine or display the Reason- Phrase.

                    The first digit of the Status-Code defines the class of response. The last two digits do not have any categorization role. There are 5 values for the first digit:

                    - 1xx: Informational - Request received, continuing process
                    - 2xx: Success - The action was successfully received,
                    understood, and accepted

                    Comment


                    • #11
                      The other applications is SAP-PI 7.10 based on Java, and not modifiable. And in its log they received the message as INVALID HTTP RESPONSE, and resend again the same message several time, so we process it more then one time, and this could be very dangerous.

                      SAP has told that is not possibly to modify so.

                      JBARTELS, we are making an standard mirth soap call, we have not made anything manually. And as you said, SAP PI 7.10 is expecting something after the HTTP 200.

                      Comment


                      • #12
                        Mirth works pretty fine with all kind of http and soap clients, so I think the problem is other. What is your Locale? in which server are you running Mirth ?

                        Anyway, I think the class you're searching is UMOMessageToHttpResponse.java under the connector/axis (there are other class with the same name under the http connector, but that one doesn't apply to your case).

                        Comment


                        • #13
                          We've just faced this problems wiht mirth 1.8.2 and SAP. The changes needed are well documented here:

                          http://forums.sdn.sap.com/message.js...sageID=8631881

                          But theer're two affected classes:

                          com.webreach.mirth.connectors.soap.axis.transport. http.transformers.UMOMessageToHttpResponse

                          and

                          com.webreach.mirth.connectors.http.transformers.UM OMessageToHttpResponse

                          Anyway, this only apply to mirth 1.8.2 as 2.0 has all this stuff changed

                          Comment

                          Working...
                          X