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

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:

Code:
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:

Code:
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:

Code:
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:

Code:
if ($r('Destination 1').getStatus() == 'SUCCESS')
	responseMap.put('Custom ACK', ResponseFactory.getSuccessResponse(''));
else
	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