web stats
Mirth Community - View Single Post - Http Listener: MalformedURLException
View Single Post
Old 12-20-2012, 08:13 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road

It works fine for me. One thing I noticed is that you're responding with a custom response variable with this message: "HTTP/1.1 200 OK<CR><LF><CR><LF". First, it's probably worth noting that the string "<CR><LF>" doesn't magically turn into a carriage return and line feed; you'll have to use '\r\n' or '\x0D\x0A' for that.

Second, assuming that the response status is SUCCESS, the HTTP Listener will already return a 200 code for you. As it stands now, here's what your channel will respond with:

HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 30
Server: Jetty(7.5.4.v20111024)

HTTP/1.1 200 OK<CR><LF><CR><LF
If you put this in your postprocessor:

responseMap.put('Custom ACK', ResponseFactory.getSuccessResponse(''));
Your source connector will still return a 200 response code, because the response status you're returning is successful. However, if you do this:

responseMap.put('Custom ACK', ResponseFactory.getFailureResponse(''));
Then your source connector will return a 500 error code. That functionality is most often used in the postprocessor to return a specific response based on the success or failure of a destination:

if ($r('Destination 1').getStatus() == 'SUCCESS')
	responseMap.put('Custom ACK', ResponseFactory.getSuccessResponse(''));
	responseMap.put('Custom ACK', ResponseFactory.getFailureResponse(''));
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.

- How do I foo?
- You just bar.
Reply With Quote