Error 404: Sending PIX message

Hi all,

I am trying to send a PIX message to OpenHIE from OpenMRS. While sending the message I am getting a 404 error.

Below is the code which I am using:

String url = “”;

  HttpClient client = HttpClientBuilder.create().build();
  HttpPost post = new HttpPost(url);
  System.out.println("HttpPost object created");

  	List<NameValuePair> urlParameters = new ArrayList<NameValuePair>();
  	urlParameters.add(new BasicNameValuePair("username", "admin"));

  	urlParameters.add(new BasicNameValuePair("password", "admin"));
  	urlParameters.add(new BasicNameValuePair("body", pixXmlMessage));

  	urlParameters.add(new BasicNameValuePair("port", "5001"));
  	//urlParameters.add(new BasicNameValuePair("num", "12345"));

  	post.setEntity(new UrlEncodedFormEntity(urlParameters));
  	System.out.println("post.setEntity Called");
  	HttpResponse response = client.execute(post);

  	System.out.println("\nSending 'POST' request to URL : " + url);
  	System.out.println("Post parameters : " + post.getEntity());

  	System.out.println("Response Code : " + 
  	BufferedReader rd = new BufferedReader(

  			new InputStreamReader(response.getEntity().getContent()));
  	StringBuffer result = new StringBuffer();
  	String line = "";

  	while ((line = rd.readLine()) != null) {

   catch (IOException e) {


Here is the response which I am getting:

Response Code : 404

404 Not Fou


Not Found

The requested URL /ws/rest/v1/patien

ts/ was not found on this server.

Apache/2.2.22 (Ubuntu) Server

at Port 80

I would be glad if someone could help me resolve this issue.

Thanks & Regards

Sara Fatima